Skip to content

Instantly share code, notes, and snippets.

@leogdion
Last active March 15, 2017 14:42
Show Gist options
  • Save leogdion/7892cd0cbdb9fac8ad092679869e8ae8 to your computer and use it in GitHub Desktop.
Save leogdion/7892cd0cbdb9fac8ad092679869e8ae8 to your computer and use it in GitHub Desktop.
git submodule foreach aliases
function __git_submodule_foreach_commit () {
git submodule foreach "git commit -am $1" && git commit -am $1
}
function __git_submodule_foreach_push () {
git submodule foreach "git push" && git push
}
function __git_submodule_foreach_pull () {
git submodule foreach "git pull" && git pull
}
function __git_submodule_foreach_commit_and_push () {
__git_submodule_foreach_commit $1
__git_submodule_foreach_push
}
alias gsFcommit="__git_submodule_foreach_commit"
alias gsFpull="__git_submodule_foreach_pull"
alias gsFpush="__git_submodule_foreach_push"
alias gsFcpush="__git_submodule_foreach_commit_and_push"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment