Skip to content

Instantly share code, notes, and snippets.

@miikka
Last active August 8, 2018 07:27
Show Gist options
  • Save miikka/dda2a443f3a357c541f3 to your computer and use it in GitHub Desktop.
Save miikka/dda2a443f3a357c541f3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Intearctively select one of the recent branches and checkout it.
set -e
git rev-parse --is-inside-work-tree >/dev/null
git checkout $(git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ | fzf -q "$*")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment