2012-11-14 2 views
9

또 다른 문제에서 수신 :힘내 1.8 :이 오류를 밀어 : DST 심판 심판/헤드/마스터가 자식 1.8 이상의 SRC

$ git push 
error: dst ref refs/heads/master receives from more than one src. 
error: failed to push some refs to '[email protected]:xxx.git' 

제안? 1.8로 업그레이드하기 전에 작동했습니다.

$ git push origin :refs/heads/refs/heads/master 
remote: warning: Allowing deletion of corrupt ref. 
To [email protected]:xxx.git 
- [deleted]   refs/heads/master 

그 무엇 없음 아이디어와 이유가 손상이었다

$ git remote -v 
origin [email protected]:xxx.git (fetch) 
origin [email protected]:xxx.git (push) 

주위에 인터넷 검색 후 나는이 첫 번째 시도했다.

$ 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]:xxx.git' 

여전히 작동하지 않는,하지만 origin master 작업을했다 적어도 :

$ git push origin master 
Counting objects: 42, done. 
To [email protected]:xxx.git 
3e3fc87..6e11d2a master -> 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]: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으로 일부 repos 작업을하지만, 대부분은 origin master을 추가해야합니다. 그러나 왜 그런지 이해할 수 없으며이 문제가 혼자있는 것일 수는 없습니다.

+0

'[remote "origin"]'및'[branch "master"]의 내용을 표시 할 수 있습니까? '? 또한,'ls.자식/심판/원격/원산지'. –

+0

자,하지만 그게 내가 '고정 된'이후이다. – firedev

+0

나는 refs/heads/refs/heads/anywhere (.git /와 서버 쪽 모두를 보았다.)를 제외하고는 똑같은 문제가있다. 나에게 제안 된 것처럼 글로벌 설정에서 이것들을 가지고있다 : push.default = matching remote.origin.push = HEAD – mirabilos

답변

0

this git old patch에 설명되어 무엇에 따라 (2007 년!)

Some refs go stale, e.g. when the forkee rebased and lost some objects needed by the fork.
The quick & dirty way to deal with those refs is to delete them and push them again.

However, git-push first would first fetch the current commit name for the ref, would receive a null sha1 since the ref does not point to a valid object, then tell receive-pack that it should delete the ref with this commit name.
delete_ref() would be subsequently be called, and check that resolve_ref() (which does not check for validity of the object) returns the same commit name. Which would fail.

refs/heads/refs/heads/master 아무것도에 부적절 (defining hierachical branch name에 대한 네임 스페이스를 사용하여) "심판/헤드/마스터"라는 이름의 지점, 포인트처럼 보인다.
삭제하는 것이 올바른 방법이었습니다.

+0

나는 이해하지 못한다 - 나는 아마도 두 개의 브랜치를 가졌지 만 단순히 내 자신의 저장소에 커밋한다. 혼자서 프로젝트에. 이것은 1.8 종류의 전환 버그입니까? – firedev

+0

@Nick 아니요, 원격 저장소에서 부정확 한 상태라고 생각합니다.이 상태는 잘못된 저장소 이름 인''refs/heads/master' '를 가져 왔습니다. 따라서 다음 푸시에 관한 문제. – VonC

+0

며칠 후 나는 약간의 변화를 만들었고 나는 다시 밀어 넣을 수 없다. – firedev

1

refs 트리의 추가 사본이 refs/remotes/origin 내에있는 것 같습니다. refs/remotes/origin에는 refs 디렉토리가 있습니까? 어떻게 이런 일이 있었는지는 모르겠지만 문제의 원인이 될 수 있습니다. Git이 refx의 약어를 처리하는 방식 (origin/master과 같은 접미어 만 사용하여 접두어를 삭제할 수 있음)로 인해 refs/remotes/origin/masterrefs/remotes/refs/remotes/origin/master을 혼동하여 혼란을 느낄 수 있습니다.

나는이 상태에 어떻게 들어 갔는지 모른다. 아마도 힘내 도구의 버그 일 수도 있고, 어떤 점에서 실수 한 오타 일 수도 있습니다. 이 중복 분기를 추적하는 원격 분기를 삭제하여 문제의 절반을 수정했습니다. refs/remotes/origin/refs 디렉토리를 삭제하면 문제의 나머지 부분을 해결할 수 있고 git push을 다시 할 수 있습니다. 실수로

git push master otherBranch master moreBranches 

이 오류를 얻을 : 당신은 두 번 밀어하려고하는 지점의 이름 즉를 입력하면

+0

이제 약간의 변경을했고 동일한 문제가 다시 발생했습니다. – firedev

+0

@ 닉 변경된 사항은 무엇입니까? 앞서 언급 한 것처럼 .git/refs/remotes/origin/refs를 지우셨습니까? 'rm -r'을 디렉토리에두고 모든 서브 디렉토리를 지우고 싶다면'rm -r'을해야한다는 것을 기억하십시오. –

+0

나는 약간의 코드를 변경하고 밀고 싶다는 뜻이다. 'rm -r'도 도움이되지는 않지만 git'push origin master'로 밀어 넣을 수 있습니다 : $ rm -r .git/refs/remotes/origin/refs/ $ git push 오류 : dst ref refs/heads/마스터는 하나 이상의 src로부터 수신합니다. 오류 : '[email protected] : xx.git'에 대한 일부 참조를 푸시하지 못했습니다. – firedev

9

이 오류를 얻을 수있는 또 다른 방법이다.

git push master otherBranch moreBranches