Skip to content

Instantly share code, notes, and snippets.

@kunicmarko20
Last active August 25, 2021 10:01
Show Gist options
  • Save kunicmarko20/9eada2be3aeca9396849573bf068d57f to your computer and use it in GitHub Desktop.
Save kunicmarko20/9eada2be3aeca9396849573bf068d57f to your computer and use it in GitHub Desktop.
Select branch to checkout from a list of recent ones.
#!/bin/bash
select branch in $(git branch --sort=-committerdate | head -n6 | grep -v "*")
do
git checkout $branch
exit
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment