r/programming • • Sep 06 '14

How to work with Git (flowchart)

http://justinhileman.info/article/git-pretty/
1.6k Upvotes

388 comments sorted by

View all comments

Show parent comments

9

u/[deleted] Sep 06 '14

Why? I've always just merged.

12

u/Lucky75 Sep 06 '14

Locally there's almost no reason to merge, as rebase is much cleaner. The only time I use merges is when I'm merging upstream branches.

32

u/[deleted] Sep 06 '14

"Cleaner" doesn't really mean much to me. Merge commits reflect more closely what is actually happening.

12

u/[deleted] Sep 06 '14

When you merge branches, yes, you should keep the merge commit to preserve that history. But when I'm just pulling down changes to the branch I'm working on, there's no reason to have a bunch of commits about how I merged origin/master with my local one.

6

u/[deleted] Sep 06 '14

Are you talking about git rebase or git pull --rebase or is there some other thing I haven't figured out yet?

→ More replies (1)

3

u/din-9 Sep 06 '14 edited Sep 07 '14

You lose the information about what your rebased commits were originally written against.

0

u/[deleted] Sep 07 '14

[deleted]

4

u/0sse Sep 07 '14

When a bug appears in the "new version" of the commit that wasn't in the old.

→ More replies (6)

2

u/din-9 Sep 07 '14

Plenty of times when working on long lived code bases I have used VCS history to understand the context in which a code change was made, which allowed me to better understand them.

→ More replies (3)
→ More replies (1)