Information Technology Reference
In-Depth Information
# sarah's command
$ git fetch -p
Now the work on
doc
branch is finished. There is no remote branch
doc
in the
shared repository or in any other member's repository other than John's. John is the
leader and he is responsible for the integration of the
doc
branch into the
master
branch. He can use any method that was discussed in
chapters 6
and
7
.
For example, he
can merge the
doc
branch into the
master
branch in such a way that it forms a bulb.
The exact procedure was presented in Recipe 7-6. Once he integrates the
doc
branch
into the
master
branch John pushes the master branch containing the
doc
branch in-
to the shared repository. This is done exactly as in Recipe 10-4 and maybe (if John
needs to rebase the bulb) with Recipe 7-9.
John can restrict the access to remote branches using gitolite, as discussed in Recipe
11-10.
How It Works
The command:
$ git push [remote-name] [branch-name]
creates the remote branch named
branch-name
in the repository aliased by
remote-name
. To succeed, the branch
branch-name
has to exist in the repository
where you are working. It doesn't have to be your current branch, however. If you want
to push your current branch you can use:
$ git push [remote-name] HEAD
Used for an ordinary local branch without
-u
, as in:
$ git push origin doc
the command performs three actions:
• It creates a remote tracking branch
origin/doc
in the local repository.
• It creates a remote branch
doc
in remote repository.