Information Technology Reference
In-Depth Information
* master dc30648 a3
The repositories look like
Figure 10-2
.
Figure 10-2
.
The state of the repositories after John's a1, a2, a3 commits
John sends his
a1
,
a2
, and
a3
revisions to the
shared-repo
repository with:
# john's command
$ git push -u origin master
The command creates a new branch in the remote
shared-repo
repository. The
new remote branch is named
master
. Thanks to the
-u
parameter the above com-
mand creates a remote tracking branch
origin/master
in
johns-repo
. You can
verify it with the
$ git branch -a -vv
command. The output would be similar
to:
* master dc30648 [origin/master] a3
remotes/origin/master dc30648 a3
As you can see John's repository contains a local tracking branch
master
and a re-
mote tracking branch
origin/master
. We can say that the
-u
parameter converted
the ordinary local branch named
master
into a local tracking branch. The repositories
now look like
Figure 10-3
.