How to fix broken submodule configuration in git?

I hit this git error when creating a submodule. I had the wrong url in the command, now all extra runs show this error. Any ideas on what's wrong?

$ git submodule add -f https://github.com/Shougo/vimproc.vim.git .vim/bundle/vimproc Adding existing repo at '.vim/bundle/vimproc' to the index fatal: Not a git repository: .vim/bundle/vimproc/../../../.git/modules/.vim/bundle/vimproc Failed to add submodule '.vim/bundle/vimproc' 
+6
source share
1 answer

Maybe the submodules added an index. You must remvoe of the index.

To completely remove a submodule, follow these steps.

1 remove these lines in .git / config

 [submodule ".vim/bundle/vimproc"] url = https://github.com/Shougo/vimproc.vim.git 

2 delete these lines in .gitmodules

 [submodule ".vim/bundle/vimproc"] path = .vim/bundle/vimproc url = https://github.com/Shougo/vimproc.vim.git 

3 delete the submodule directory

 rm -rf .vim/bundle/vimproc 

4 non-stationary submodule

 git rm --cached .vim/bundle/vimproc 

5 delete the submodule directory in .git / modules

 rm -rf .git/modules/.vim/bundle/vimproc 

finally a submodule.

+15
source

Source: https://habr.com/ru/post/956457/


All Articles