Skip to content

Instantly share code, notes, and snippets.

@wh1pch81n
Created August 3, 2017 12:43
Show Gist options
  • Save wh1pch81n/7ae515c723dfd88eefa8052355493fe6 to your computer and use it in GitHub Desktop.
Save wh1pch81n/7ae515c723dfd88eefa8052355493fe6 to your computer and use it in GitHub Desktop.
quick git commands
# 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