Table of Contents

Git - Fetch (Remote Repository Sync)

About

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

It will mostly

git fetch:

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