Skip to content
Browse files

added git-delete-submodule for delete submodules easily

  • Loading branch information...
1 parent 81ede0a commit 68cf02be47a6d245538bbf1eeacd80b227dfd220 @jweslley jweslley committed with tj Oct 8, 2010
Showing with 10 additions and 0 deletions.
  1. +1 −0 AUTHORS
  2. +9 −0 bin/git-delete-submodule
View
1 AUTHORS
@@ -15,3 +15,4 @@ Patches and Suggestions
- Domenico Rotiroti
- Jason Young
- Nick Campbell
+- Jonhnny Weslley
View
9 bin/git-delete-submodule
@@ -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

0 comments on commit 68cf02b

Please sign in to comment.
Something went wrong with that request. Please try again.