Header

git fetch

Retrieving new commits and branches from a remote repository

The git fetch command allows you to fetch newly updated branches and commits from a remote repository, but not affect your local working copy.

Simply type:

$ git fetch origin

Where origin is the name of the configured remote repository. This remote repository will be contacted and any fresh data will be downloaded, but without affecting any uncommitted work.

This is a safe way of looking at what other developers have been working on in the repository.

In this respect it's quite different to git pull which will actually update your working copy - you can view more information about the differences between the commands in this guide.

Proudly powered by Katapult. Running on 100% renewable energy.