Skip to content

Git:Troubleshooting:Push

Push명령어 도중 발생되는 문제점에 대하여 정리한다.

fatal: The remote end hung up unexpectedly

소스 파일 사이즈보다 postBuffer 사이즈가 작은 것이 문제였다. git config 커맨드로 http.postBuffer 사이즈를 늘려주면 간단하게 해결할 수 있다.

$ git config http.postBuffer 104857600

No refs in common and none specified; doing nothing

아래와 같은 에러가 발생할 수 있다. 맨 처음 git repository로 push할 때 발생한다. 처음 위치를 어디로 정해야 할지를 얘기해달라는 것이다. master로 넣을지..

$ git push 
No refs in common and none specified; doing nothing. 
Perhaps you should specify a branch such as 'master'. 
fatal: The remote end hung up unexpectedly 
error: failed to push some refs to ‘git 주소’

다음과 같이 origin master 를 추가해서 push하면 된다.

$ git push origin master

receive.denyCurrentBranch

이 문제는 여기서 생성한 git 저장소가 bare 저장소가 아니기 때문에 발생한 오류이다.
우리가 일반적으로 보는 저장소는 non-bare 저장소인데 파일 수정들의 작업을 하는 워킹 디렉토리가 있는 저장소가 non-bare 저장소이고 bare 저장소는 워킹디렉토리 없이 변경사항만 관리하게 된다.
non-bare 저장소에서(여기서는 origin 폴더) 이 문제를 해결하려면 git config receive.denyCurrentBranch ignore을 실행해서 현재 브랜치에서 푸시를 받도록 설정하면 정상적으로 푸시를 할 수 있다.
또는 리모트 저장소를 Bare속성으로 다시 생성하면 된다.

Agreeing to the Xcode/iOS license requires admin privileges

push명령 도중 아래와 같은 에러가 발생될 수 있다.

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

이 경우 아래의 명령으로 라이선스에 동의해야 한다.

$ sudo xcodebuild -license

HTTP 413 curl 22 The requested URL returned error

$ git push -v

다음과 같은 에러가 발생할 수 있다.

Pushing to https://git.server-project.com/blackhole/opm.git
Enumerating objects: 79, done.
Counting objects: 100% (79/79), done.
Delta compression using up to 8 threads
Compressing objects: 100% (68/68), done.
POST git-receive-pack (chunked)
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
Writing objects: 100% (69/69), 4.82 MiB | 4.59 MiB/s, done.
Total 69 (delta 35), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

서버에 전송 가능한 Body 크기(Content-Length) 제한이 걸려있다. 이 값을 늘려야 한다. Gitlab#HTTP 413 curl 22 The requested URL returned error 항목 참조.