Last Updated: February 25, 2016
·
546
· klj613

Stop using pull and start using fetch/merge/rebase

When I started using git a while ago I didn't really know what was going on until I started using fetch/merge/rebase.

If you don't know how to use fetch/merge/rebase separately then I'd suggest to do exactly that. Once you know how to use them then go back to pull if you wish.

git fetch will update your origin/* / remote_name/* references.

Once you've got the commits/data locally then you can use merge/rebase accordingly.

git fetch
git checkout master

git merge origin/master
or
git rebase origin/master

Also, pull will use your branch 'tracking' information. Which I prefer not to use personally and I specify where to push to, what to merge, what to rebase every time.


I can't remember the last time I used pull :)