Skip to content

Commit

Permalink
Added git-delete-submodule
Browse files Browse the repository at this point in the history
Cherry-picked from jweslley / git-extras
Commit: jweslley/git-extras@f235670a3e19
  • Loading branch information
DarthNerdus committed Mar 28, 2011
1 parent 0d6ec0b commit 8156446
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions git-delete-submodule
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

test -z $1 && echo "submodule required" && exit 1
test ! -f .gitmodules && echo ".gitmodules file not found" && exit 2

NAME=$(echo $1 | sed 's/\/$//g')
test -z $(git config --file=.gitmodules submodule.$NAME.url) && echo "submodule not found" && exit 3

git config --remove-section submodule.$NAME
git config --file=.gitmodules --remove-section submodule.$NAME
git rm --cached $NAME

0 comments on commit 8156446

Please sign in to comment.