Así que de alguna manera he logrado crear un submodule zombi zombi.
$ cat .gitmodules [submodule "Source/CrashProbe"] path = Source/CrashProbe url = https://github.com/bitstadium/CrashProbe.git
git piensa que el submodule no está rastreado:
$ git status On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) Source/CrashProbe/
Deinit no funciona:
$ git submodule deinit Source/CrashProbe error: pathspec 'Source/CrashProbe' did not match any file(s) known to git.
Esto tampoco lo hace:
$ git rm --cached Source/CrashProbe fatal: pathspec 'Source/CrashProbe' did not match any files
… a pesar de que:
$ ls .git/modules/Source/CrashProbe/ FETCH_HEAD gitdir objects HEAD hooks packed-refs branches index refs config info sourcetreeconfig description logs
Esto tampoco lo hace:
$ git config -f .git/config --remove-section Source/CrashProbe fatal: No such section!
… a pesar de que:
$ cat .git/config ... [submodule "Source/CrashProbe"] url = https://github.com/bitstadium/CrashProbe.git
Eso sobre agota todas las respuestas TAN que he visto hasta ahora, entonces mi pregunta es: ¿Cómo salgo de este desastre y tengo un submodule adecuado?
Intente eliminar manualmente el file y la statement del submodule.
.gitmodule
para eliminar Source/CrashProbe
. Source/CrashProbe
(eliminación simple, no se necesita command git, ya que no se rastrea de todos modos) .git/modules
para eliminar cualquier traza Source/CrashProbe
en ella. Una vez hecho esto, agregue y confirme (para volver a un estado limpio).
Y luego testing tu command git submodule add nuevamente
git submodule add -- https://github.com/bitstadium/CrashProbe.git Source/CrashProbe
Y resultó que había olvidado hacer un git commit
.
Cómo odio a git y su interfaz críptica …
Editar: Creé el submodule, pero no incluí el directory del submodule en mi confirmación. Esto dejó el repository en un estado inconsistente (.gitmodules commited, submodule not). El informe de error de Git es, digamos, deficiente.