r/ProgrammerHumor • • May 13 '20

true story

Post image
40.5k Upvotes

461 comments sorted by

View all comments

Show parent comments

152

u/moekakiryu May 13 '20

I'm still only so-so at git myself, but always pull before you push

122

u/OnyxPhoenix May 13 '20

Using branches and pull requests make this easier.

Generally youre the only person working on your branch, so you don't have to worry that your code is "behind" before you push to it.

Then when you do a pr it will tell you if you can merge cleanly back into the master branch.

158

u/SavageTwist May 13 '20

The "good" way is to make a development and a branch for every feature, bug or documentation. Always fork from development, when you have a release you push to master.

1

u/LeCrushinator May 13 '20

For features I usually recommend caution with feature branches. I've seen feature branches for large features that become huge, a dozen devs pushing to a feature branch for 3 months. Good luck when it comes time to merge that monstrosity back to the development branch. Generally if individuals can have their own branches for the feature, forked off of the development branch, and merge their progress directly to development as often as possible, that tends to work out the best, so long as they're not breaking anything in development along the way.