2012-05-24 2 views
2

서버의 gitosis가 관리하는 git 저장소로 푸시하려고합니다. 어떻게 든 gitosis에서 비 맨발 저장소가 있습니까?

[email protected]:~/lyre$ git push 
Enter passphrase for key '/home/william/.ssh/id_dsa': 
Counting objects: 9, done. 
Compressing objects: 100% (5/5), done. 
Writing objects: 100% (5/5), 705 bytes, done. 
Total 5 (delta 4), reused 0 (delta 0) 
remote: error: refusing to update checked out branch: refs/heads/master 
remote: error: By default, updating the current branch in a non-bare repository 
remote: error: is denied, because it will make the index and work tree inconsistent 
remote: error: with what you pushed, and will require 'git reset --hard' to match 
remote: error: the work tree to HEAD. 
remote: error: 
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to 
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into 
remote: error: its current branch; however, this is not recommended unless you 
remote: error: arranged to update its work tree to match what you pushed in some 
remote: error: other way. 
remote: error: 
remote: error: To squelch this message and still keep the default behaviour, set 
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'. 
To r:lyre 
! [remote rejected] master -> master (branch is currently checked out) 
error: failed to push some refs to 'r:lyre' 

나는이 질문을 발견 :

Git push error '[remote rejected] master -> master (branch is currently checked out)'

을하고 행운과 함께, 거기에 대답을 시도 내가 누르면,이 오류가 발생합니다. 원격 저장소는 gitosis로 설정되었으므로 .git 폴더가 없습니다. 작업 트리 나 체크 아웃 된 분기가 없어야합니다.

저장소 폴더 구조

는 다음과 같습니다

[email protected]:/home/git/repositories/lyre.git$ ls -hal 
total 40K 
drwxr-xr-x 7 git users 4.0K May 24 12:58 . 
drwxr-xr-x 5 git users 4.0K May 4 2011 .. 
drwxr-xr-x 2 git users 4.0K May 4 2011 branches 
-rw-rw-r-- 1 git users 66 May 24 12:58 config 
-rw-r--r-- 1 git users 73 May 4 2011 description 
-rw-r--r-- 1 git users 23 May 4 2011 HEAD 
drwxr-xr-x 2 git users 4.0K May 4 2011 hooks 
drwxr-xr-x 2 git users 4.0K May 4 2011 info 
drwxr-xr-x 163 git users 4.0K Apr 26 15:26 objects 
drwxr-xr-x 4 git users 4.0K May 4 2011 refs 

[email protected]:/home/git/repositories/lyre.git$ cd branches/ 
[email protected]:/home/git/repositories/lyre.git/branches$ ls -hal 
total 8.0K 
drwxr-xr-x 2 git users 4.0K May 4 2011 . 
drwxr-xr-x 7 git users 4.0K May 24 12:58 .. 

어떻게이 혼란에서 빠져 나와 저장소에 밀어 수 있습니까?

+0

원격 저장소가 어떻게 보이나요? 1 차 수준 폴더는 무엇입니까? – CharlesB

+0

@CharlesB 저장소 폴더 구조를 추가했습니다. –

+0

'branches' 디렉토리 란 무엇입니까? 내 벌거 벗은 리포지터리에 있지 않아, 그 내용을 확인할 수 있니? – CharlesB

답변

1

PEBCAK. 내가 복제 한 것으로 생각한 저장소를 복제하지 않았다. 내가 아닌 저장소에 푸시하려고 시도했다.

원격 서버에서 gitosis 저장소는 /home/git/repositories/lyre.git/이고 또한 /home/william/lyre/에 복제본이 있습니다. ,

host r 
    user william 

내가 저장소를 복제 할 때 나는 git clone r:lyre 함께했고, 실수로 복제 대신 gitosis의 REPO를 복제 :

내 로컬 워크 스테이션에 나는과 같이 ~/.ssh/config을 설정합니다. 내가 밀어 붙이려고 할 때, 나는 실제로 맨손이 아닌 레포로 향하고있었습니다.

나는 이것에 ~/.ssh/config 변경 :

host r 
    user git 

을 내 모든 문제가 도망 갔어요. 이것은 모두 잘못된 정체성의 경우입니다.

관련 문제