Table of Contents

About

A fetch will sync information locally from a remote repository. It will receive missing objects from another repository.

It will mostly

git fetch:

  • download new remote branch
  • download all commits added since the last fetch to the actual branch ( The head of the last fetch are saved in the fetch_head file.)
  • download new tags

from one or more other remote repositories

remote branche cannot be modify directly, you need to create a tracking branch (ie a local branch that tracks the remote branch head)

FETCH_HEAD

The last commit (head) fetched for all branches are in the FETCH_HEAD file located a git_dir/FETCH_HEAD 1)

.gitconfig

[fetch]
    # make sure we delete branch origin/blah if blah is deleted on the server,
    # and also do it automatically for all the remotes that we have configured.
    prune = true
    pruneTags = true
    all = true