개발관련/기타

git pull - unable to update local ref

localslave 2024. 10. 4. 17:08

참조: https://uncle-bae.blogspot.com/2017/02/git-pull.html


Git을 이용하여 pull을 수행할때 다음과 같은 오류가 날 수 있다.

오류상황 :

error: unable to resolve reference refs/remotes/origin/xxxx_file: No such file or directory
From git+ssh://remoteserver/~/test
 ! [new branch]      xxxx_file -> origin/xxxx_file  (unable to update local ref)
error: unable to resolve reference refs/remotes/origin/split-css: No such file or directory
 ! [new branch]      xxxx_file2  -> origin/xxxx_file2  (unable to update local ref)

다음 명령어를 이용하면 불필요하게 꼬인 파일을 제거하여 정상으로 pull을 당길 수 있다.

$ git gc --prune=now
$ git remote prune origin