Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 454
    I found this well written article about git fetch and git pull it's worth the reading: longair.net/blog/2009/04/16/git-fetch-and-merge Commented Sep 16, 2010 at 6:57
  • 76
    Our alternative approach has become git fetch; git reset --hard origin/master as part of our workflow. It blows away local changes, keeps you up to date with master BUT makes sure you don't just pull in new changes on top on current changes and make a mess. We've used it for a while and it basically feels a lot safer in practice. Just be sure to add/commit/stash any work-in-progress first ! Commented May 4, 2014 at 14:32
  • 44
    Make sure you know how to use git stash correctly. If you're asking about 'pull' and 'fetch' then maybe 'stash' will also need explaining... Commented Dec 9, 2014 at 20:09
  • 52
    Lots of folks coming from Mercurial keep using "git pull", thinking it's an equivalent for "hg pull". Which it's not. Git's equivalent of "hg pull" is "git fetch". Commented Jun 29, 2015 at 10:15
  • 3
    Slightly off question, but I have developed the habit of entering "git fetch && git status" instead of "git status". By itself "git status" reports the last remote repository status seen. This can report stale information about the remote repository. For example, "git status" will report "Your branch is up to date" despite a new commit having been pushed. Commented Jan 16, 2024 at 19:04