TortoiseGit: What's the difference between "Git Sync", "Fetch" and "Pull"?

smwikipedia picture smwikipedia · Mar 14, 2016 · Viewed 27.4k times · Source

I am moving from TortoiseSvn to TortoiseGit. But enountered some unexpected difficulties.

My working paradigm is as simple as:

  1. Check out code
  2. Change some code
  3. Share with others for code review
  4. Commit changes

Why bother to have the 3 syntactically similar commands below?

And Pull and Fetch even share the identical icon. What a user-friendly design!

enter image description here

Answer

Tomasz Madeyski picture Tomasz Madeyski · Mar 14, 2016

These are three different commands:

  1. Git pull is a git fetch followed by git merge - read here
  2. Git fetch fetches info about remote repositories - read here
  3. Git sync does everything in one command meaning pull and push read here

If you want to compare git and svn workflow then git pull is like svn update. There's no direct svn version of git fetch. Git sync is like svn up && svn commit in one command