To push a specific branch, run git push <remote> <branch>
. In your case, your only defined remote is origin
, and you want to push your feature
branch, so that makes
$ git push origin feature
The “Examples” section of the git push
documentation describes what happens if you run git push
with no other arguments.
git push
Works like git push <remote>
, where is the current branch’s remote (or origin
, if no remote is configured for the current branch).
Given the configuration in your question, your feature
branch does not have a remote configured, so the above invocation is equivalent to the next example.
git push origin
Without additional configuration, works like git push origin :
…
Following the daisy chain, we see that this is equivalent to
git push origin :
Push “matching” branches to origin. See in the OPTIONS section above for a description of "matching" branches.
The rules for matching branches are
The special refspec :
(or +:
to allow non-fast-forward updates) directs git
to push “matching” branches: for every branch that exists on the local side, the remote side is updated if a branch of the same name already exists on the remote side. This is the default operation mode if no explicit refspec is found (that is neither on the command line nor in any Push line of the corresponding remotes file—see below) and no push.default
configuration variable is set.
In your case, the only matching branch is master
, so git push
will push that branch and exit.