Recent Posts
Recent Comments
Archives
반응형
250x250
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Today
Yesterday

Total
05-05 03:02
관리 메뉴

Hey Tech

Github 에러 해결: "gwarning: adding embedded git repository:" 본문

SW 개발/Git

Github 에러 해결: "gwarning: adding embedded git repository:"

Tony Park 2022. 6. 2. 15:03
728x90
반응형

❓ 에러 메시지

Add 중 다음과 같은 에러를 마주했습니다(그림 1).

gwarning: adding embedded git repository: mecab-0.996-ko-0.9.2/mecab-python-0.996
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: 
hint: git submodule add <url> mecab-0.996-ko-0.9.2/mecab-python-0.996
hint: 
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint: 
hint: git rm --cached mecab-0.996-ko-0.9.2/mecab-python-0.996
hint: 
hint: See "git help submodule" for more information.

그림 1. 에러 메시지(add)

status를 찍어보니 아래와 같은 에러 메시지가 나옵니다(그림 2).

그림 2. 에러 메시지(status)

commit + push를 해도 파일 업로드가 안 되더군요.

💡 원인

저의 경우, 에러 메시지에 등장하는 폴더 안에 추가적으로 .git 파일이 있던 게 문제가 되었습니다. 해당 폴더에 있는 모든 파일 정보를 출력해 보니 .git 파일이 있었습니다(그림 3).

ls -a

그림 3. 하위 폴더 내 .git 파일

✅ 해결방법

문제가 되는 폴더 내 .git 파일을 모두 삭제해 주면 문제가 해결됩니다(그림 4).

rm -rf .git

그림 4. .git 파일 삭제

다시 status를 찍어 보니 워킹 트리가 깔끔하다고 나오네요(그림 5).

그림 5. 문제 해결


포스팅 내용에 오류나 오탈자가 있을 경우 댓글 남겨주시면 감사드리겠습니다.

그럼 오늘도 멋진 하루 만드시길 바랍니다😊

고맙습니다 :)

728x90
반응형
Comments