Skip to content

Instantly share code, notes, and snippets.

@javifr
Created July 10, 2012 15:02
Show Gist options
  • Save javifr/3083874 to your computer and use it in GitHub Desktop.
Save javifr/3083874 to your computer and use it in GitHub Desktop.
git submodules help

Basic commands with git submodules

Cloning a repo that has submodules

git clone --recursive XXXXX.git path

Modify content of a submodule from your project

cd to de path of the subdmoule and work normally

Adding a submodule

git submodule add XXXXX.git path/path

When working with submodules inside submodules

git submodule update --init --recursive

Adding submodules and switching to a branch without subdmoules and with folder

( related: http://git-scm.com/book/en/Git-Tools-Submodules#Issues-with-Submodules )

  • mv folder giving problems
  • checkout branch
  • merge ( will delete folders, will bring .gitmodules, .. )
  • g submodule update ( ready to go! )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment