Tagged as: git linux

git pull and git fetch have different uses, even if in general usage they do fairly similar tasks. It is important to understand which to use and when.

git fetch downloads the latest changes from the remote, but does not affect your working copy, or branches on your local repository. The downloaded branch is stored in <remote>/<branch>, e.g. origin/master.

git pull is effectively git fetch followed by git merge <remote>/<branch>. Any changes in the remote repository are merged into your local branch. This is useful if you just want your local repository to reflect the changes that have happened in the remote, but is generally counterproductive when you are developing in your local branches and collaborating with others on the remote.