Last active
November 29, 2021 09:19
-
-
Save MarcusResell/630c77f2bc549f4680fed4b5da43d743 to your computer and use it in GitHub Desktop.
List all local branches according to time and pick which one you want to checkout
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
# List all local branches according to time and pick which one you want to checkout | |
# requires xargs, awk, fzf, sed to be installed | |
lb = !git branch --sort='-committerdate' --format='%(color:green)%(committerdate:relative)%(color:reset) %(refname:short)' | fzf --ansi --layout=reverse --border=rounded --info=hidden --height=10 | sed 's/.*ago[ ]*//g' | xargs git checkout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment