Skip to content

Instantly share code, notes, and snippets.

@nielswind
Created April 16, 2021 09:47
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 nielswind/646b1b77a2588b15055a14e7291cbe81 to your computer and use it in GitHub Desktop.
Save nielswind/646b1b77a2588b15055a14e7291cbe81 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
[[ -x `which fzf` ]] || (echo fzf required; exit 1)
export FZF_DEFAULT_OPTS='--height 40% --border'
B=$((git-notlocal) | fzf -1 --prompt 'checkout remote branch: ' | tr -s ' '|cut -d" " -f2)
[[ ! -e "$B" ]] && git checkout $B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment