4 ms·
The main use case for rebase for me is to add automatic rebases on pull to the git config. Normally if you pull from the remote and have local commits not in t
by pandemi 9y ago
The main use case for rebase for me is to add automatic rebases on pull to the git config.
Normally if you pull from the remote and have local commits not in the remote, you'll have an "extra" merge. Automatic rebase on pull takes care of this, to avoid those useless merges.
- andybak 9y agoSurely our tools should simply have an option of hiding useless merges. It's a display problem not a reason to change history.
- mvc 9y agoThey do. git log --no-merges
- fulafel 9y agoThey are not useless: they record when git used its fallible automatic merging logic to reconcile changes in two different branches. It works most of the time, but you really want to keep a record of it for later troubleshooting. Have a look at https://github.com/git/git/blob/master/Documentation/merge-strategies.txt https://github.com/git/git/blob/master/Documentation/merge-s... to get some idea what is going on behind the scenes in automatic merges.
- derimagia 9y agogit rebase gives that just fine, even demonstrated here: https://git-scm.com/blog/2010/03/08/rerere.html https://git-scm.com/blog/2010/03/08/rerere.html.