From the manpage for git pull:
git-pull - Fetch from and merge with another repository or a local branch
Git pull is identical to git fetch && git merge $remote_branch. He's saying that it prevents you from learning how branching works. So, if he were explicit, he should say 'Don't use git until you know how branching works at some level.', which is good advice. Not using git pull is a pretty sensational way to get at that nugget.
* If you `git pull`, you don't get the chance to diff between your local branch and what you just fetched and check if you really want to do that merge, using `git fetch` and `git merge` makes it more likely you'll do that check
* Getting used to `git fetch` means if you need to diverge from the straight `git fetch; git merge` workflow (because you want to rebase, or you have a high number of active topic branches floating around) you're already halfway there.
Very nice description of a number of use cases. I was just a bit annoyed that the title was described in a very hand-waving way (do it because it's more useful sometimes). With so many other examples I really expected a detailed description of some situation where fetch/pull makes a huge difference.
Not sure if it warrants an article but I've never found any use for git-pull either. When I want to fetch and merge/rebase, I can do just that; I never figured why would I want to use git-pull for it. But on the other hand, I've only used git for about five years and I've only learned the most important low-level commands yet.
git is deep. And you can do the same thing using different steps and different number of steps. I think this post provided a good tip on how to go about merging remote changes into your local. If one finds that git pull requires a lot of cleanup activity, git fetch and git merge is a good way to go..
Interesting to learn. In Mercurial (which is what I use primarily) pull does not merge unless you ask it to. Is there a list anywhere of gotchas in git for people coming from other DVCS? (i.e. things like commands with the same name that do subtly different things, such as this)
> In Mercurial (which is what I use primarily) pull does not merge unless you ask it to.
Actually, in Mercurial `pull` does not ever merge. It can update if you ask it to (with `-u`), but it won't merge.
`hg fetch` (standard extension) can merge (it's basically "pull and update, if update fails merge"), but it might go the way of the dodo pretty soon[0]
[+] [-] justin_vanw|14 years ago|reply
From the manpage for git pull: git-pull - Fetch from and merge with another repository or a local branch
Git pull is identical to git fetch && git merge $remote_branch. He's saying that it prevents you from learning how branching works. So, if he were explicit, he should say 'Don't use git until you know how branching works at some level.', which is good advice. Not using git pull is a pretty sensational way to get at that nugget.
[+] [-] masklinn|14 years ago|reply
* If you `git pull`, you don't get the chance to diff between your local branch and what you just fetched and check if you really want to do that merge, using `git fetch` and `git merge` makes it more likely you'll do that check
* Getting used to `git fetch` means if you need to diverge from the straight `git fetch; git merge` workflow (because you want to rebase, or you have a high number of active topic branches floating around) you're already halfway there.
[+] [-] viraptor|14 years ago|reply
[+] [-] natesm|14 years ago|reply
[+] [-] stock_toaster|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] yason|14 years ago|reply
[+] [-] adamjernst|14 years ago|reply
[+] [-] anandpdoshi|14 years ago|reply
[+] [-] ZoFreX|14 years ago|reply
[+] [-] masklinn|14 years ago|reply
Actually, in Mercurial `pull` does not ever merge. It can update if you ask it to (with `-u`), but it won't merge.
`hg fetch` (standard extension) can merge (it's basically "pull and update, if update fails merge"), but it might go the way of the dodo pretty soon[0]
[0] http://www.selenic.com/pipermail/mercurial-devel/2011-August...
[+] [-] dexen|14 years ago|reply
hg pull == git fetch
git pull == { hg pull; hg merge; }
[+] [-] mise|14 years ago|reply
[+] [-] DrJ|14 years ago|reply
[+] [-] freedrull|14 years ago|reply