Use git pull
with rebase
When you use git pull
, by default, Git will:
- Fetch the latest commit for the branch you’re on from the specified (or default) remote
- Perform a merge of that latest commit into your current commit
This isn’t great because usually merging isn’t great. So reconfigure your git pull
to
“pull with rebase instead”:
git config --global pull.rebase true
After doing that, if you prefer to use git pull
(instead of git fetch
/ git rebase
separately), you can do so
comfortable in the knkowledge that Git will rebase instead of merging after the latest commits are fetched.