Hard 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, the local or the remote, is not called master
).
To be sure to execute the command git show-ref
(which lists local references). A line should appear:
<algum SHA1> refs/heads/master
And just in case, do it too git ls-remote
(which lists remote reffers). A line with the same reference name should appear:
<algum SHA1> refs/heads/master
Would that be your problem?
Understanding...
The complete (plus) syntax of the command git push
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 takes over master
as both the local branch name and the remote name.
It is possible to use different names for the two branches, to do this the complete form is used or configured in the file .git/config
.
If by chance the simplified form is used without such configuration the error message is exactly the mentioned: "src refspec does not any match.". That is, the part src
(the local branch) of refspec (which is the name of such a syntax complete with :
) married no other reference (does not any match). This "other reference" in the case is (implicitly) a remote reference (origin in his case).
In other words: git tried to use the same name for the source and destination branches but did not find two-sided branches with the given name.
I do with the
git push origin master
.– Altemberg Andrade