Created
October 23, 2019 07:28
-
-
Save prezire/bbdfa4c983834175a025498d3d5e57ef to your computer and use it in GitHub Desktop.
Basic Git Submodule Commands
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
#Main proj. | |
#Add a submodule. | |
git submodule add https://proj.git | |
#Go to submodule's dir and change to specific branch. | |
cd submodule_dir | |
git checkout -b branch origin/branch | |
#Go back to proj root and push to repo along with the new submodule's new branch. | |
git add . -u | |
git commit ... | |
git push | |
#Forking proj. | |
git checkout -b branch origin/branch | |
#Use the submodule that the main proj is using. | |
git submodule update --init |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment