Skip to content

Instantly share code, notes, and snippets.

@danielestevez
Created July 23, 2012 07:48
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 danielestevez/3162459 to your computer and use it in GitHub Desktop.
Save danielestevez/3162459 to your computer and use it in GitHub Desktop.
Create brnaches and push to remote for all GIT submodules
function newbranch() {
git submodule foreach git checkout ${1}
git submodule foreach git pull origin ${1}
git submodule foreach git co -b ${2}
git submodule foreach git push origin ${2}
git status
}
# newbranch master newbranchname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment