fatal: remote part of refspec is not a valid name in .git/refs/heads/master:.git/refs/remotes/origin/master
I know that it would be easier to use git push origin master
, but if I do:
git push origin .git/refs/heads/master:.git/refs/remotes/origin/master
I get:
开发者_如何转开发fatal: remote part of refspec is not a valid name in .git/refs/heads/master:.git/refs/remotes/origin/master
Why doesn't this work?
I'm only trying to follow:
git push [remotename] [localbranch]:[remotebranch]
Refspecs aren't relative path names, "absolute" refspecs just start with refs/
. The most "absolute" version of what you are trying to push would be:
git push origin refs/heads/master:refs/remotes/origin/master
However, this is not equivalent to git push origin master
. What this does is updates the remote's remote tracking branch origin/master
so that it may or may not reflect what its remote origin
is actually at.
The equivalent of git push origin master would be:
git push origin refs/heads/master:refs/heads/master
精彩评论