안단테 안단테

git 사용할 때 에러 본문

IT 기술/Information

git 사용할 때 에러

안단테에 2023. 2. 7. 09:57
728x90
반응형

Counting objects: 7, done.

Delta compression using up to 4 threads.

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

Writing objects: 100% (5/5), 584 bytes | 0 bytes/s, done.

Total 5 (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 test-git@000.000.000.000:/home/test-git/project

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

error: failed to push some refs to 'test-git@000.000.000.000:/home/test-git/project'

 

이런 에러 뜨면

 

## repository 로 이동

cd /var/lib/git/myproj.git
git config --bool core.bare true

## 그리고 .git 을 제외하고 remote repository 의 모든 파일 삭제 

 

이렇게 해줌

728x90
반응형

'IT 기술 > Information' 카테고리의 다른 글

git bash 한글 설정  (0) 2023.02.07
git 원격 저장소 이용  (0) 2023.02.07
github 사용법  (0) 2023.02.07
Git 설치 및 사용법  (0) 2023.02.06
Open JDK 적용 방법  (0) 2023.02.06
Comments