Created
September 9, 2015 08:05
-
-
Save ejmr/75b5b624396d326d5d62 to your computer and use it in GitHub Desktop.
Checkout a Git Branch Using Fuzzy-Selection
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
#!/bin/sh | |
# | |
# git pick-branch | |
# | |
# This command checks out a branch, using the commnad `pick` to | |
# provide fuzzy-selection of the branch names. | |
# | |
# https://github.com/thoughtbot/pick | |
# | |
###################################################################### | |
git branch -a \ | |
| sed "s:remotes/::" \ | |
| sed "s:origin/::" \ | |
| grep -v "HEAD" \ | |
| cut -c 3- \ | |
| sort -u \ | |
| pick \ | |
| xargs git checkout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment