Skip to content

Instantly share code, notes, and snippets.

@m-tmatma
Last active December 28, 2020 00:06
Show Gist options
  • Save m-tmatma/382ad3f43640801d29af8c7973af93ee to your computer and use it in GitHub Desktop.
Save m-tmatma/382ad3f43640801d29af8c7973af93ee to your computer and use it in GitHub Desktop.
git checkout by peco
alias co='git rev-parse --is-inside-git-dir > /dev/null 2>&1 \
&& git checkout $(git branch -a | grep -v "/HEAD" | peco | sed -r "s#^\\s+remotes/origin/##" | sed -r "s#^\*\s+##")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment