Skip to content

Instantly share code, notes, and snippets.

@costis
Last active October 13, 2015 08:38
Show Gist options
  • Select an option

  • Save costis/4169119 to your computer and use it in GitHub Desktop.

Select an option

Save costis/4169119 to your computer and use it in GitHub Desktop.
git submodules

How to manage git submodules

Add new

git submodule add http://blah.blha.com/project.git a_project_path
git add *
git commit -m "adding a submodule"

Update

cd a_project_path
git pull
cd ..
git commit -m "updating the submodule"

Remove a submodule

  • Delete the relevant section from the .gitmodules file.
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Commit and delete the now untracked submodule files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment