Or does it expand to git push origin <current-branch-name>
?
git push [remote-name] [branch-name]
By default, git push
expands to git push origin <current-branch>
since Git 2.0
or git push origin <all-matching-branches>
for older versions.
The answers to all your questions regarding git push
are in the documentation page of git push
: http://git-scm.com/docs/git-push
A fragment from that page (I removed the myriad of options as they are not mentioned in the question):
git push ... [<repository>] [<refspec>]
When the command line does not specify where to push with the
<repository>
argument,branch.*.remote
configuration for the current branch is consulted to determine where to push. If the configuration is missing, it defaults toorigin
.When the command line does not specify what to push with
<refspec>...
arguments or--all
,--mirror
,--tags
options, the command finds the default<refspec>
by consultingremote.*.push
configuration, and if it is not found, honorspush.default
configuration to decide what to push (Seegit-config[1]
for the meaning ofpush.default
).
Since Git 2.0
the default value of push.default
is simple
which means push current branch with some checks and conditions that can make git
refuse to push
in some situations.
Before Git 2.0
, the default value of push.default
used to be matching
which means push all branches having the same name on both ends. This mode also requires some conditions to be met in order to succeed.
For more details about push.default
see the documentation page of git config
or type git help config
on your terminal.