Last active
September 4, 2018 20:34
-
-
Save blackfalcon/02f4734867c2a66ac76e87d2f829dfc9 to your computer and use it in GitHub Desktop.
Easy Git branch switcher in the CLI
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
# put this in your .bashrc | |
function switch() { | |
git branch | grep "$1" | pbcopy && tmp=$(pbpaste) && git checkout $tmp | |
} | |
# example branch ... 8038031-update-things-long-branch-name-of-things | |
# use in the CLI | |
# $ switch 38031 (or any unique searchable string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment