Remove a git submodule

Using git-submodule is include code can be very useful, however it doesn't have a particularly easy method of removing it in the even you change your mind on including another project's entire git history in your own.

There are a number of manual steps to get the process done and the project removed.

This has since been simplified into the following which removes the submodule from .gitmodules and the working directory.

  1. git rm <submodule path>
  2. git commit

To completely remove a submodule, manually delete $GIT_DIR/modules/&lt;name&gt;/.