Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created November 17, 2016 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igaiga/daf4dbc198bd9f5d9a174a7225c453f9 to your computer and use it in GitHub Desktop.
Save igaiga/daf4dbc198bd9f5d9a174a7225c453f9 to your computer and use it in GitHub Desktop.
# peco + git branch -r + git co
function peco-g-branch-checkout () {
local selected=$(git branch -r | peco --query "$LBUFFER" | awk -F/ '{print $NF}')
if [ -n "$selected" ]; then
git checkout -b ${selected} origin/${selected}
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment