본문 바로가기
TIL

TIL 240722 - 에러 해결 "warning: adding embedded git repository"

by lemonpie611 2024. 7. 22.

1. 에러 원인

일단, 초기 셋팅을 할 때 프론트랑 백엔드를 구분하기 위해 아래와 같이 디렉토리를 만들었다.

 

여기서 final_project_frontend 는 mkdir 명령어로 생성하였고, final_project_backend는 nest new ~~ 명령어로 nest 초기세팅을 하는 동시에 디렉토리도 만들었다. 

 

그리고 root 디렉토리에서 git init을 누르면 다음과 같이 에러가 나타난다.

 

warning: 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.

 

그러니까, backend 디렉토리를 nest new ~~ 명령어로 생성하면서 backend 디렉토리 안에 .git 파일도 이미 만들어졌기 때문에 에러가 발생한 것이다.

 

2. 해결 방법

.git 을 삭제하면 된다.

rm -rf .git

 

'TIL' 카테고리의 다른 글

TIL 240724 - WebRTC 구현하기 - 1:1 P2P 연결 (1)  (1) 2024.07.24
TIL 240723 - WebRTC 란?  (0) 2024.07.23
TIL 240719 - Redis  (0) 2024.07.19
TIL 240718 - Lexorank  (0) 2024.07.18
TIL 240716 - Nest.js에서 jest를 이용해 테스트코드 구현  (0) 2024.07.16