开发者

fatal: remote part of refspec is not a valid name in .git/refs/heads/master:.git/refs/remotes/origin/master

开发者 https://www.devze.com 2023-04-02 11:30 出处:网络
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 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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号