Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think you're missing the point. Rebasing work you haven't pushed disentangles your work from the remote branch.

Here are some advantages:

1. Work you happened to do after a merge doesn't spuriously appear to depend on that merge.

2. You can do conflict resolution incrementally during the rebasing process (commit-by-commit instead resolving a merge conflict all at once).

3. Linearizing more of your history improves the precision of git bisect. You're much more likely to have the result of a bisect point to a simple commit rather than a complex merge when there are fewer merges.

The two major disadvantages I see are:

1. Pulling and rebasing is more complex than pulling and merging (more steps and more decisions).

2. You have to be careful not to rebase a branch you have "published".



This reply is a bit late but...

You're not supposed to do work on the same feature after a merge. I'm not advocating pulling master (or whatever the base branch is) often and merging whenever, so that you end up with loads of pointless merges. Once your feature is done, you merge once. This makes point 3 pretty much moot, since bisect handles merges just fine.

Sometimes you need to update your code on top of a new base because of some important bugfix or something, and then it's fine to rebase, but I don't think it should be the default.

I'll accept point 2, though I think git's merging is good enough that it's not noticeable in most cases. If you rebase you also lose information about the conflicts which may be undesirable. Someone might want to review your merge to see if you have solved the conflicts correctly.


Agree with what fpgeek said, and I would add further that rebasing by default for pull, certainly does not preclude you from using local-only feature branches!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: