Last active
June 23, 2020 07:19
-
-
Save barrydobson/56191e491050a7797c53f78888130ee1 to your computer and use it in GitHub Desktop.
GIT submodules
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 tracking master | |
git submodule add -b <branch> <repo> <name> | |
# Update a submodule | |
git submodule update --remote | |
# Update a submodule from a parent repo | |
cd path/to/submodule | |
git add <files> | |
git commit -m "comment" | |
git push | |
cd /main/project | |
git add path/to/submodule | |
git commit -m "updated my submodule" | |
git push | |
# Remove a submodule | |
git submodule deinit <path_to_submodule> | |
git rm <path_to_submodule> | |
git commit-m "Removed submodule" | |
rm -rf .git/modules/<path_to_submodule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment