Skip to content

Instantly share code, notes, and snippets.

@Om4ar
Forked from u840903/git-submodules.md
Created April 28, 2020 11:52
Show Gist options
  • Save Om4ar/2d558228271c177e1ce4df4af093daec to your computer and use it in GitHub Desktop.
Save Om4ar/2d558228271c177e1ce4df4af093daec to your computer and use it in GitHub Desktop.
Github Submodule Cheat Sheet

Add a submodule

git submodule add https://github.com/janjarfalk/canvasrunner.git components/canvasrunner/

Update all submodules

git submodule foreach git pull origin master cd .. git commit . -m "Updated submodules" git push

Remove a submodule

git submodule deinit components/canvasrunner
git rm components/canvasrunner

Edit a submodule

cd components/canvasrunner git commit . -m "Edited" git push cd ... git commit . -m "bumped canvasrunner" git push

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