Git Pull vs Git Fetch

The git pull command is basically like “Get Latest Version” in TFS. It pulls down the latest changes for a repository and merges them into the local files in your computer.

I don't think there is an equivalent in TFS for the git fetch command. The closest thing to it in TFS is probably viewing history, then manually checking to see what changes you are missing. Or doing a merge of branches to see what is different.

In comparison to the git pull command, running git fetch will not pull down any changes. From what I understand, all it does is compare the changes/code in the remote repository with your own local repository. Then it can tell you whether your local repository is behind or ahead, as far as changes go, with the remote repository. This is even better than what you can do in TFS, because it allows you to see exactly what changes you don't have on your local repository.

Tags: #Git #TeamFoundationServer

Discuss... or leave a comment below.