Last active
January 28, 2018 21:30
-
-
Save stevenvo/73007912f7f913bf88e13004acb77efc to your computer and use it in GitHub Desktop.
Useful Git Command
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
# Pulling a git repository as a git module into your project | |
# "master" is the branch of the remote repository to use | |
git submodule add -b master https://github.com/Komodo/trackchanges.git src/modules/trackchanges | |
# get status recursively | |
git submodule status --recursive | |
# Iterate through all git submodule to add and comment and commit | |
git submodule foreach git add . | |
git submodule foreach git commit -m "test" | |
git submodule foreach git push | |
# git submodule foreach git push -u origin master | |
## BASH file that add, comment, and commit using comment as input | |
#!/bin/bash | |
git submodule foreach git add . | |
git submodule foreach git commit -m "$1" | |
git submodule foreach git push | |
git add . | |
git commit -m "$1" | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment