Information Technology Reference
In-Depth Information
• When you commit with $ git commit you move your local tracking
branch forward.
• When you fetch with $ git fetch you move your remote tracking
branch forward.
• When you push with $ git push you move the remote branch and the
remote tracking branch forward.
The tracking can be always inspected with the $ git branch -a -vv com-
mand. The output lists:
• Ordinary local branches as:
lorem
a1b2c3f Some commend
• Local tracking branches as:
ipsum
a1b2c3f [origin/ipsum] Some comment
• Remote tracking branches as:
remotes/origin/dolor
a1b2c3f Some comment
The $ git branch -a -vv command doesn't list remote branches. To list re-
mote branches you have to first fetch them with $ git fetch . We can say that $
git branch is a local command—it doesn't perform a network transfer between
your local and remote repositories.
You will find the exact procedures to set and remove tracking in Recipes 10-4 and
10-5. They are quite simple if you understand the role of each type of branches.
The distributed role of git was underlined by recipes that presented team work with
and without a central repository. To grasp the idea even further try to run the following
command in any of the repositories:
$ git fetch --no-tags https://github.com/github/GitPad
master:refs/remotes/xyz/pqr
The command fetches the master branch from the repository ht-
tps://github.com/github/GitPad and stores it in the .git/refs/re-
motes/xyz/pqr file. The operation copies the revisions from the GitPad repository
Search WWH ::




Custom Search