삽질 좋아/오류 해결
[Error] [Github] remote error: upload-pack: not our ref ~ (submodule commit 에러 해결)
싱브이
2024. 4. 23. 15:03
728x90
반응형
오류 내용
Error: fatal: remote error: upload-pack: not our ref a4942f59da114ea76bc8d22c2a51463acc36fef0
이건 서브 모듈의 HEAD가 Detached 상태에서 push 를 했을 때 발생하는 문제이다!
메인 프로젝트가 가지고 있는 submodule의 정보는 repository 자체가 아니라, commit -id 이기 때문에 push 를 해도 되지 않는다!
해결 방법
서브 repo(private)에 push 하기 전! 브랜치 변경이 필요하다.
#본 프로젝트 안에 생성된 서브 프로젝트로 이동
cd private 프로젝트 폴더
git checkout {branch}
git add .
git commit -m '메시지'
git push origin {branch}
#본 프로젝트로 이동
cd ..
git add .
git commit -m "메시지"
git push origin {branch}
728x90
반응형