You may have noticed that many times when you do a git pull to sync
your local repo with the master, you get a merge commit. And then
when you push your changes to the repo, there are many of these merge
commits.
While not really a problem, it does clutter the repo with extraneous
merge commits. My friend pointed this out to me and said that we can
get rid of these by doing one of several things:
o Use git pull --rebase
o Edit .git/config to have something like
[branch "master"]
remote = origin
merge = refs/heads/master
rebase = true
o Add the following to ~/.gitconfig
[branch]
autosetuprebase = true
It's not necessary to do this, but I think it makes the tree a little
cleaner.
Some links describing these issues:
http://viget.com/extend/only-you-can-prevent-git-merge-commitshttp://mislav.uniqpath.com/2013/02/merge-vs-rebase/http://stackoverflow.com/questions/8509396/git-pull-results-in-extraneous-merge-branch-messages-in-commit-log.
Ray