How to fix a directory that Git thinks is a submodule
Nuts. I added and committed a directory to my Git repository when the directory itself was another separate Git repository. Now Git thinks it's some sort of submodule, but it doesn't know how to deal with it:
1 2 |
|
And worse, Git won't let me remove it:
1 2 3 4 5 |
|
So what to do? This:
1 2 |
|
In my case I had a situation where there were several Git repositories-inside-a-repository, so I wanted a way to deal with them all:
1 2 3 4 5 6 |
|
(Be careful not to run this find
command at the root of your Git repository, of course, or else you will effectively destroy its usefulness as a git repo. )