Created
July 24, 2014 21:58
-
-
Save dangerouse/4b81080887c7d1ec2807 to your computer and use it in GitHub Desktop.
Fuzzy git checkout
This file contains 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
# given a branch like 750-feature-name | |
# gcb 750 | |
# sponge $ gcb 750 | |
# checking out 750-feature-name | |
# Switched to branch '750-feature-name' | |
function gcb() { | |
branches=`git branch` | |
branchName=`echo "$branches" | grep $1` | |
branchName=`echo "$branchName" | sed s/\*//` | |
echo "checking out $branchName" | |
git co $branchName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment