Skip to content

Instantly share code, notes, and snippets.

@Swop
Created May 5, 2013 13:59
Show Gist options
  • Select an option

  • Save Swop/5520908 to your computer and use it in GitHub Desktop.

Select an option

Save Swop/5520908 to your computer and use it in GitHub Desktop.
Delete submodule
oldPath="vendor/example"
git config -f .git/config --remove-section "submodule.${oldPath}"
git config -f .gitmodules --remove-section "submodule.${oldPath}"
git rm --cached "${oldPath}"
rm -rf "${oldPath}" ## remove src (optional)
rm -rf ".git/modules/${oldPath}" ## cleanup gitdir (optional housekeeping)
git add .gitmodules
git commit -m "Removed ${oldPath}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment