git 1.8 的另一个问题:
$ git push
error: dst ref refs/heads/master receives from more than one src.
error: failed to push some refs to 'gitosis@xxx.xx:xxx.git'
建议?它在升级到 1.8 之前一直有效。
$ git remote -v
origin gitosis@xxx.xx:xxx.git (fetch)
origin gitosis@xxx.xx:xxx.git (push)
谷歌搜索后我首先尝试了这个:
$ git push origin :refs/heads/refs/heads/master
remote: warning: Allowing deletion of corrupt ref.
To gitosis@xxx.xx: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 'gitosis@xxx.xx:xxx.git'
仍然不工作,但 origin master
至少工作了:
$ git push origin master
Counting objects: 42, done.
To gitosis@xxx.xx: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 = gitosis@xxx.xx:xx.git
push = HEAD
[branch "master"]
remote = origin
merge = refs/heads/master
ls .git/refs/remotes/origin:
HEAD master refs
最后,现在我每次都必须执行 git push origin master
。最烦人的是一些 repo 协议(protocol)与 git push
一起工作,但在大多数情况下我必须添加 origin master
但我不明白为什么,它可以是我一个人遇到这个问题。
最佳答案
出现此错误的另一种方法是,如果您不小心输入了两次要推送的分支的名称,即:
git push master otherBranch master moreBranches
产生这个错误。一旦您意识到自己已经完成,修复就很明显了:
git push master otherBranch moreBranches
关于混帐 1.8 : it push error: dst ref refs/heads/master receives from more than one src,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13373528/