Git

[Git] bare repository 오류

Dave Song 2022. 5. 30. 17:25

remote: error: refusing to update checked out branch: refs/heads/develop
remote: error: By default, updating the current branch in a non-bare repository

오류 해결

 

# bare repository를 사용하는 이유

공유하기위한 목적으로 bare epo를 생성합니다. 다수의 작업자, 프로젝트 참가자의 변경 사항을 공통으로 관리하기 위한 저장소로 사용할 수 있습니다.

 

bare repo라고 불리는 이 저장소에는 실제 작업되는 파일, 디렉토리가 저장되는 것이 아닌 변경사항, 이력등의 revision history의 정보들을 저장한다. 

 

[문제해결]

git config --list를 사용하여 여러 config 정보를 리스트로 출력하였다.

push.default=simple
user.name=YourName
user.email=YourEMail
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=RepositoryURL
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.develop.remote=origin
branch.develop.merge=refs/heads/develop

 

push가 안되서 해당 명령어를 원격저장소에서 사용하여 문제를 해결하였다.

git config --bool core.bare true