Created
May 7, 2014 15:54
-
-
Save ltw/c40accc2ea50265a0af4 to your computer and use it in GitHub Desktop.
This is a rough first-pass implementation at a `git checkout` alias that matches on partial branch names. I'd ideally like to make this a little nicer and/or fuzzy-matching.
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
| gcof () { | |
| git branch | cut -c 3-1000 | grep $1 | head -1 | xargs git checkout | |
| } | |
| # $ git branch | |
| # * master | |
| # remember-the-fifth-of-november | |
| # $ gcof fifth | |
| # Switched to branch 'remember-the-fifth-of-november' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment