I added a git submodule with the following command:
git submodule add https://github.com/spaceship-prompt/spaceship-prompt.git --depth=1
This command mistook --depth=1
as a module name, rather than the repo depth. When I run git submodule
I get:
a5d55898822e75cb34ee1c3cefe52822c820c220 zshrc/zsh_prompts/--depth=1 (v3.11.2-386-ga5d5589)
Now I want to remove this submodule. Since I have not run git submodule init
, I can run git rm -f "--depth=1"
to remove it, but get the following error:
error: unknown option `depth=1/'
usage: git rm [<options>] [--] <file>...
-n, --dry-run dry run
-q, --quiet do not list removed files
--cached only remove from the index
-f, --force override the up-to-date check
-r allow recursive removal
--ignore-unmatch exit with a zero status even if nothing matched
--pathspec-from-file <file>
read pathspec from file
--pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character
How do I escape the --
in the submodule name and remove it?