-
-
Save Om4ar/2d558228271c177e1ce4df4af093daec to your computer and use it in GitHub Desktop.
Github Submodule Cheat Sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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 | |
<edit> | |
git commit . -m "Edited" | |
git push | |
cd ... | |
git commit . -m "bumped canvasrunner" | |
git push | |
``` | |
### Clone repositories with submodules | |
``` | |
git clone --recursive | |
``` | |
### Pull submodule if you forgot to clone --recursive | |
``` | |
cd components/canvasrunner | |
git submodule update --init | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment