IT/DEV

[GIT] 원격에서 땡겨온 후 서브모듈이 없어서 빌드 안됨

ttoogi 2023. 5. 24. 11:47

Ref

http://nabilbenyoussef.blogspot.com/2018/08/git-submodule-update-already-exists-and.html

Issue

IDE: 안드로이드 스튜디오

gitlab에서 clone 해왔는데 서브모듈 두개 중 하나가 찾을 수 없다고 해서 git submodule udpate --remote 만 했는데 안됨.

git submodule update -> already exists and is not an empty directory

When typing this :

git submodule update

Having this error :

fatal: destination path 'xxx' already exists and is not an empty directory.   
fatal: clone of 'git@bitbucket.org:xxxxx/your-repo.git' into submodule path 'xxx' failed  

Solution

git submodule deinit --force .   
git submodule init   
git submodule update --recursive

Useful command

git submodule init
git submodule update --remote
git submodule update --remote --recursive
git rm -r tas-speech-service
git submodule foreach 'git status'