Created
February 11, 2013 21:58
-
-
Save rrajendran/4757979 to your computer and use it in GitHub Desktop.
Loops through all the git projects and branches to a given name. usage: ./gitbranch.sh <branch-name>
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
| #!/bin/bash | |
| gitbranch() { | |
| while read data; do | |
| cd $data | |
| git stash | |
| git checkout $1 | cat | |
| git pull | |
| cd .. | |
| echo | |
| done | |
| } | |
| #list all directories, pipe to gitbranch. | |
| ls -d */ | gitbranch $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment