It opens a fuzzy finder window showing the branches you have in the repo, sorted by recency. Also shows the latest committer and the date. Hit enter on the one you want to swap to it.
Spoiler it’s fzf under the hood. But it’s perfect and simple.
asb 2 hours ago [-]
Even better (IMHO!) is `git config branch.sort -committerdate` (note the `-`). This will sort newest committer date first.
pkaodev 2 hours ago [-]
I have this as an alias in my .zshrc!! Very handy
ComputerGuru 40 minutes ago [-]
FYI/fwiw Fish shell autocompletes branches sorted by last commit date when writing out git commands. It also provides completions for commitish objects grouped by class, giving precedence to the usual targets first, with each group sorted by its own sort key. Handy!
zahlman 34 minutes ago [-]
How many branches would you need to have to make this worthwhile?
woodruffw 25 minutes ago [-]
I've seen monorepos with over 10k active branches. But even at a smaller scale (10-100 branches), it becomes useful when manually stacking and/or rebasing, especially if you have a smaller terminal.
jamietanna 32 minutes ago [-]
At any time I'm working across 5-30 branches (some when I'm reviewing other folks' code) so it's handy to see my latest branches
monster_truck 28 minutes ago [-]
I just click on tower and open it, much better
woodruffw 15 minutes ago [-]
Another useful one if you have a large number of tags and want to see the most recently created ones first:
git config --global tag.sort -creatordate
(`-creatordate` reverses the sort so that the newest come first.)
It opens a fuzzy finder window showing the branches you have in the repo, sorted by recency. Also shows the latest committer and the date. Hit enter on the one you want to swap to it.
[0] - https://github.com/paulirish/git-recent