-
-
Save nielswind/646b1b77a2588b15055a14e7291cbe81 to your computer and use it in GitHub Desktop.
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/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