Difficult to say with 100% certainty, but most likely the problem is that your local branch has a different name than the server branch (more precisely one of the two branches, local or remote, is not called master
).
To be sure, run the command git show-ref
(which lists local references). A line should appear:
<algum SHA1> refs/heads/master
And, just in case, run git ls-remote
(which lists remote refineries). You should see a line with the same reference name:
<algum SHA1> refs/heads/master
Would that be your problem?
Understanding ...
The (more) complete syntax of the git push
command is:
git push <nome do remoto> <nome do branch local>:refs/heads/<nome do branch remoto>
When you use the syntax mentioned in the comments, git push origin master
git assumes master
both as local branch name and remote name.
You can use different names for the two branches, for this the complete form is used or it is set up in the file .git/config
.
If you use the simplified form without such a configuration, the error message is exactly that: "refspec does not match any." . That is, the src
(the local branch) part of refspec (which is the name of such a complete syntax with :
) did not match any other reference ). This "other reference" in the case is (implicitly) a reference of the remote origin in your example).
In other words: git tried to use the same name for the source and destination branches but did not find branches on both sides with the given name.