Information Technology Reference
In-Depth Information
• It sends the revisions required revisions from local database to the remote
database.
If you use the
-u
flag then the ordinary local branch
doc
is converted into a local
tracking branch for the remote tracking branch
origin/doc
.
This is how you can create a remote branch with the same name as one of your local
branches. If you want to create a remote branch with different name then your local
branch use the following syntax:
$ git push [remote-name]
[local-branch-name]:[remote-branch-name]
The command:
$ git push origin foo:bar
sends the local branch named
foo
and stores it at the remote end under the
bar
name. The above command:
• Creates the remote branch
bar
in the remote repository
• Creates the remote tracking branch
origin/foo
in local repository
• Sets the local branch
foo
as a local tracking branch for the remote track-
ing branch
origin/foo
If you want to remove a remote branch use:
$ git push [remote-name] :[remote-branch-to-remove]
as in:
$ git push origin :foo
The above command:
• Deletes the remote branch
foo
in
origin
• Deletes the remote tracking branch
origin/foo
inyourlocal repository