Created
August 3, 2017 12:43
-
-
Save wh1pch81n/7ae515c723dfd88eefa8052355493fe6 to your computer and use it in GitHub Desktop.
quick git commands
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
# Checkouts out all branches based on arg name. e.g. master | |
function git_checkout_all { CMD="git checkout $1 && git submodule foreach 'git checkout $1'"; eval $CMD; }; git_checkout_all master; | |
# Make branch for all e.g. feature | |
function git_branch_all { CMD="git branch $1 && git submodule foreach 'git branch $1'"; eval $CMD; }; git_branch_all feature; | |
# Commit all | |
function git_commit_all { CMD="git submodule foreach 'git commit -am \"$1\" || echo \"\"' && git commit -am \"$1\""; eval $CMD; }; git_commit_all "msg"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment