added git-delete-submodule for delete submodules easily

This commit is contained in:
Jonhnny Weslley 2010-10-08 10:32:02 -03:00
parent 4c9a87025d
commit 6f98d7954a
2 changed files with 10 additions and 0 deletions

View file

@ -15,3 +15,4 @@ Patches and Suggestions
- Domenico Rotiroti
- Jason Young
- Nick Campbell
- Jonhnny Weslley

9
bin/git-delete-submodule Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
test -z $1 && echo "submodule required" && exit 1
test ! -f .gitmodules && echo ".gitmodules file not found" && exit 2
test -z $(git config --file=.gitmodules submodule.$1.url) && echo "submodule not found" && exit 3
git config --remove-section submodule.$1
git config --file=.gitmodules --remove-section submodule.$1
git rm --cached $1