Skip to content

Instantly share code, notes, and snippets.

@sangeeths
Last active January 2, 2016 02:29
Show Gist options
  • Save sangeeths/8237082 to your computer and use it in GitHub Desktop.
Save sangeeths/8237082 to your computer and use it in GitHub Desktop.
Git commands to create and update submodules
Creating a submodule:
git clone <parent-repo-url>
cd path/to/parent/repo
git submodule add <repo-url> path/to/submodule
Initializing a submodule:
git submodule init
git submodule update
Updating a submodule:
cd path/to/submodule
git checkout master
[add, edit, delete files..]
git add .
git commit -m "updating submodule"
git push
Updating the parent repo:
cd path/to/parent/repo
git add .
git commit -m "updated submodule"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment