Git

[Git] 오류 : submodule add

수여닝 2022. 1. 10. 22:39

안녕하세요,

오늘은 간단히 git 오류를 만나서 해결한 방법을 알려드리려고 합니다!


git에서 클론받아서 다시 업로드 하려고 하니까 같은 내용은 폴더로 묶어서 업로드하려고 하니까 이런 오류를 만났습니다!

hint: You've added another git repository inside your current repository.

hint: Clones of the outer repository will not contain the contents of

hint: the embedded repository and will not know how to obtain it.

hint: If you meant to add a submodule, use ...

hint: git rm --cached 폴더이름

이렇게 하라는 대로 해봤더니 

(use -f to force removal) 

강제로 삭제한 후 올려보니 제가 원하는대로 올라가지는 않았습니다..

.git 파일 확인

그래서 검색해본 결과 clone받을 때 .git 파일이 생성되는데 그게 제대로 지워지지 않았던게 문제였습니다!

< 해결방법 >

rm -rf .git   (.git파일이 있는 위치에서)

git rm -r --cached  하위파일이름 (상위파일에서)

이렇게 하니까 제대로 올라갔습니다.

저와 같은 오류를 만나시는 분들께 도움이 되었으면 좋겠습니다!