개발(Git)

Git 사용 트러블 슈팅

수릭스 2019. 11. 6. 16:11
반응형

< trouble shooting & note >
- Push  해서 오류 나는 것들은 오류 메시지에 따라 오류 fix 합니다.
- 기본적으로 ignore 리스트는 정리를 해두고 수행하는 게 좋습니다. Ignore도 add해서 활용 하는 것 확인이 필요합니다.
windows git insufficient permission for adding
서버 저장소 권한 설정을 바꾸거나 C드라이브가 아닌 다른 드라이브로 변경 설정 합니다.
- tortoise git 사용시 git clone 후 "git clone  SSL certificate problem: self signed certificate in certificate chain" 오류가 발생할 경우 Tortoise git 셋팅 에서 git 카테고리 'Edit systemwide gitconfig' 에서 [http] 탭에 sslVerify = false 를 추가 후 실행.
다른 PC에서 git repository 셋팅 PC  push가 안될 때, 확인 사항
Bitvise SSH Server 설정 확인

- 다른 PC에서 git repository 셋팅 PC 에 push가 아래와 같은 메시지로 되지 않을 때, 
remote: error: insufficient permission for adding an object to repository database ./objects 
remote: fatal: failed to write object 
error: unpack failed: unpack-objects abnormal exit 

아래와 같이 공유 폴더 권한 설정을 한다.

 - git push 후 아래 에러 메시지를 확인 합니다. 
~ ~ ~ ~ ~ 
fatal: 'origin' does not appear to be a git repository 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 
~ ~ ~ ~ ~ 
원격지의 git 서버 폴더 권한 문제로 발생 합니다. 
해당 폴더의 권한을 모두 허용으로 바꿔주고, '읽기 전용'을 해제 적용 합니다. 
git push를 다시 시도 하여 Success를 확인 합니다.

- Git push 후 아래 에러 메시지 발생.

(Case1)

더보기

git.exe push --progress "origin" master

 

Counting objects: 7, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (3/3), done.

Writing objects: 100% (7/7), 1.22 KiB | 0 bytes/s, done.

Total 7 (delta 1), 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 //…

! [remote rejected] master -> master (branch is currently checked out)

error: failed to push some refs to '…'

 

git did not exit cleanly (exit code 1) (765 ms @ 2019-11-04 오후 4:43:06)

(Case2)

더보기

git.exe push --progress "origin" master

 

Counting objects: 61, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (61/61), done.

Writing objects: 100% (61/61), 1.10 MiB | 380.00 KiB/s, done.

Total 61 (delta 52), 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 …

! [remote rejected] master -> master (branch is currently checked out)

error: failed to push some refs to '… '

 

git did not exit cleanly (exit code 1) (4103 ms @ 2019-11-05 오전 11:36:40)

 *서버쪽에 아래와 같이 조치

git config --bool core.bare true

(아래 시도 )

git reset --hard

git init --bare

클라이언트 쪽에서 아래와 같이 체크 (체크하지 않아도 ) 다시 push 수행

Push 성공됨을 확인.

 

반응형