Development/Error
[GIT] fatal: bad object refs/heads/{branch}
BongChun
2023. 8. 27. 23:39
문제상황
fatal: bad object refs/heads/feature/CICD 2
error: <https://github.com/Goorm-OGJG/PBL-Instagram-BE.git> did not send all necessary objects
- 정말 아무것도 건들지 않았는데 해당 에러가 발생했다.
- 원본 브랜치에서 fetch도 안되고, 아무것도 안된다.
해결
현재 이상한 헤드를 참조하는게 이유라고 생각이 되었다. 해결한 방법은 다음과 같다.
- .git 에 들어가보니 2 가 붙은 파일들을 볼 수 있었다.
- 해당 파일들을 모두 삭제한다.
- 특히 refs/heads/{branch} 경로에 존재하는 문제 파일은 꼭 삭제하도록 한다.
https://stackoverflow.com/questions/72515916/git-fatal-bad-object-refs-heads-2-master
Git fatal: bad object refs/heads 2/master
After a few month not working on some static website, I came back and tried to pull changes from a GitHub repo. The following fatal: bad object refs/heads 2/master error occured. (base) ➜ github_r...
stackoverflow.com
위 링크를 확인해보면 클라우드 서비스를 사용하는 사용자들이 나와 비슷한 문제를 겪었던 것으로 보인다. 나 역시 아이클라우드를 통해 클라우드로 관리를 하고 있었다.