git 1.8 的另一个问题:
$ git push
error: dst ref refs/heads/master receives from more than one src.
error: failed to push some refs to '[email protected] /cdn-cgi/l/email-protection:xxx.git'
建议?在升级到 1.8 之前它可以工作。
$ git remote -v
origin gitos[email protected] /cdn-cgi/l/email-protection:xxx.git (fetch)
origin [email protected] /cdn-cgi/l/email-protection:xxx.git (push)
在谷歌搜索之后我首先尝试了这个:
$ git push origin :refs/heads/refs/heads/master
remote: warning: Allowing deletion of corrupt ref.
To [email protected] /cdn-cgi/l/email-protection:xxx.git
- [deleted] refs/heads/master
不知道那是什么以及为什么它被损坏。
$ git pull
Already up-to-date.
$ git push
error: dst ref refs/heads/master receives from more than one src.
error: failed to push some refs to '[email protected] /cdn-cgi/l/email-protection:xxx.git'
仍然不起作用,但是origin master
至少做了工作:
$ git push origin master
Counting objects: 42, done.
To [email protected] /cdn-cgi/l/email-protection:xxx.git
3e3fc87..6e11d2a master -> master
好的,这样就解决了问题,但是问题的根源是什么?为什么 origin/master 突然损坏了?我做了什么git push origin :refs/heads/refs/heads/master
?
.git/config
:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected] /cdn-cgi/l/email-protection:xx.git
push = HEAD
[branch "master"]
remote = origin
merge = refs/heads/master
ls .git/refs/remotes/origin:
HEAD master refs
最后,现在我必须做git push origin master
每次。最烦人的是一些回购协议与git push
,但对于其中大多数我必须添加origin master
但我不明白为什么,而且不可能是我一个人遇到这个问题。