Skip to content

Instantly share code, notes, and snippets.

@eonil
Created June 3, 2015 13:20
Show Gist options
  • Save eonil/628121a99c9d2dd85f21 to your computer and use it in GitHub Desktop.
Save eonil/628121a99c9d2dd85f21 to your computer and use it in GitHub Desktop.
Git Submodule How-To

To add a submodule, first move to the container directory, and type this.

git submodule add http://...

To sync the submodule working tree files to current branch'es current commit, type this.

git submodule update

To remove a submodule, move to the container directory and type this.

git submodule deinit ./your_submodule...
git rm ./your_submodule...

Don't forget to rm the submodule directory. Otherwise the submodule will become a wondering zombie, and it's far harder to treat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment