In general, the syntax of this command is:
git push <remote> [refspec]
If the refspec is omitted it is simplified to this:
git push <remote>
And its behaviour depends on what is set in git config push.default variable. The git message says:
When push.default is set to 'matching', git will push local branches to the remote branches that already exist with the same name.
In Git 2.0, Git will default to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch.
To set 'matching' mode:
git config --global push.default matching
And to set 'simple' mode:
git config --global push.default simple
Let's go back to your specific case. Pushing commits to the remote named "origin/master" will fail because there is no "origin/master" remote existing (default remote is called "origin"). To make this working you would have to add such remote manually, e.g. by calling:
git remote add origin/master <git-repository-url>
But please note that such operation will make your local git very confused, and you will have to deal with errors like this:
$ git push origin/master
Counting objects: 5, done.
Writing objects: 100% (3/3), 253 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To [email protected]:sarxos/test.git
820474f..3706ea9 master -> master
error: unable to resolve reference refs/remotes/origin/master/master: Not a directory
error: Cannot lock the ref 'refs/remotes/origin/master/master'.
And some others:
$ git fetch origin/master
error: unable to resolve reference refs/remotes/origin/master/master: Not a directory
From github.com:sarxos/test
! [new branch] master -> origin/master/master (unable to update local ref)
error: some local refs could not be updated; try running
'git remote prune origin/master' to remove any old, conflicting branches
So I do not recommend using it.
If you want to push to origin/master (remote named 'origin' and remote branch named 'master') you should do:
git push origin master