Using git rebase
during git pull
If you have used git
for a little while and know how to rebase, you should probably enable the following:
git global config --global pull.rebase true
This means that if your branch looks like this:
origin: a-b-c-d-e-f-g
your branch: a-b-c---------x
and you want to merge in the version on origin, it will rebase your branch instead of creating a merge commit. Two of the things that I like most about rebasing on pull as opposed to having git create a merge commit are:
- if you have merge conflicts, you can fix them up one-at-a-time as opposed to having to fix all merge conflicts as once
- you don’t end up with merge commits in your git history