Skip to content

Instantly share code, notes, and snippets.

@elranu
Created January 2, 2019 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elranu/90f6997ba51b4ec89b60feec77efc064 to your computer and use it in GitHub Desktop.
Save elranu/90f6997ba51b4ec89b60feec77efc064 to your computer and use it in GitHub Desktop.
Git submodules helper
function git-checkout-b() {
git checkout -b $args[0]
$cmd = 'git checkout -b ' + $args[0]
git submodule foreach $cmd
}
function git-checkout() {
git checkout $args[0]
$cmd = 'git checkout ' + $args[0]
git submodule foreach $cmd
}
function git-branch-D() {
git branch -D $args[0]
$cmd = 'git branch -D ' + $args[0]
git submodule foreach $cmd
}
function git-update(){
git submodule update --remote --merge
}
function git-push(){
git push --recurse-submodules=on-demand
}
function git-clone(){
git clone --recursive $args[0]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment