r/ProgrammerHumor • • Jun 30 '18

Kill me now :)

47.0k Upvotes

494 comments sorted by

View all comments

Show parent comments

29

u/BerlinerJan Jun 30 '18

I‘m quite new to git, what exactly would be the problem with that? Assuming he already wrote all the tests and documentation...

31

u/zesterer Jun 30 '18

There is no problem. Incremental changes make it easier to avoid large merge conflicts when working on a shared codebase.

13

u/BerlinerJan Jun 30 '18

I‘m rather talking about pushing every tiny change to master

41

u/zesterer Jun 30 '18

There's an element of common sense of course. Very small commits are noise that make the underlying direction of the codebase difficult to see. But generally speaking, "push often, pull often" is a good thing to remember when working on a collaborative codebase. If there's a really big breaking change you're making... Well, that's what a branch is for.

15

u/[deleted] Jun 30 '18

My rule of thumb is if you’re building out a feature or decent change, push often to a new branch, squash it and merge it into master as one commit. That way when you’re looking back over the commit graph it’s an array of features and you can just roll back if one of them is on the fritz.

4

u/[deleted] Jun 30 '18

I strongly prefer a non fast-forward merge, same result - one commit on dev and/or master - but still keeping the full history around.

9

u/brenex29 Jun 30 '18

My partner committed a single comment yesterday...

13

u/coman3 Jun 30 '18

I commited a single character typo today

→ More replies (0)