Like most people new to Git, I've had my share of confusion trying to decipher the use cases applicable to git merge and git rebase. I think I've finally decided that, as far as the resulting working copy state, they give you the same thing. Also, they both result in the same conflicts. If this is incorrect, please provide an example to enlighten me.
From my point of view, the main benefit to using rebase instead of merge (if your changes haven't been pushed or pulled) is to keep the history linear. What I really don't understand is the reasoning behind developing git-rerere.
From the manpages, git-rerere is supposed to help you in the case where you're trying to resolve a conflict that you've previously resolved. The example that I'm about to refer to is found at http://www.kernel.org/pub/software/scm/git/docs/git-rerere.html.
If the policy of your project is to not constantly merge changes from the mainline into your topic branch (like the linux kernel), the above example says to create "throw-away" merge commits. Essentially, merge the master into your topic, run tests to make sure everything still works, then do a "git reset --hard HEAD^", essentially throwing the merge commit away. Later on, when you create another "throw-away" merge commit, git-rerere assists you in resolving the conflicts that you've already solved in the frst throw-away merge.
Can someone please explain why instead of going through all the trouble of creating a temporary merge commit, the developer wouldn't instead just rebase his topic onto master? Isn't that the point of git-rebase - get the changes, but avoid the merge? Doesn't this accomplish the same thing, and assuming no one has pulled your topic branch changes, wouldn't this be a much simpler approach? Is the throw-away-merge+git-rerere workflow really just for the case when your changes have been pushed/pulled?
One final question - Linus is quoted as saying "But if I see a lot of 'Merge branch linus' in your logs, I'm not going to pull from you, because your tree has obviously had random crap in it that shouldn't be there..." Would Linus also have a problem with constant rebases?