Last active
June 23, 2016 16:13
-
-
Save rxnlabs/e583c408e1e0d0f9bf70 to your computer and use it in GitHub Desktop.
Git - resetting changed submodules, updating submodules to the latest commit from the master branch. Easy way to work with Git submodules after changing files or when something goes wrong with trying to update submodules.
This file contains hidden or 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
git submodule add -b master link_to_git_repo_here_ssh_or_https path_to_clone_git_submodule_to_here |
This file contains hidden or 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
#Remove a submodule from a Git repo | |
git submodule deinit submodule_name_here && git rm --cached submodule_name_here |
This file contains hidden or 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
#http://stackoverflow.com/questions/10906554/how-do-i-revert-my-changes-to-a-git-submodule#answer-23668025 | |
git pull origin master && git submodule foreach git reset --hard HEAD && git submodule init && git submodule update --init && git submodule update && git submodule foreach "git checkout master; git pull origin master" && git submodule foreach git clean -f |
This file contains hidden or 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
git submodule update --init --recursive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment