It gives me the following output (first line for not actually included):
[branch name] [hash] [commit message header]
move-radio-and-checkbox-hints-up 9dff690 Move the hints belonging to radios/checkboxes up
update-rubocop 8cace1f Update rubocop and pry, fix some new offences
fix-remaining-injected-content-placement 48dc51d Reorder elements of other inputs
It wouldn’t surprise me if windows cmd is the most common environment for git on command line, since windows is the most common OS among developers (and git-bash is terrible).
So many commenters here providing alternatives seem to miss the key differentiating feature: recently checked out vs. recently committed to. For me the former is immensely more useful as I may have gone to a branch to do something other than commit, and those are missed with the latter.
Anyway, I’ve had my own (far more involved) version of listing recently checked-out branches for years. It will also filter out the current branch and deleted branches, and has a rudimentary interactive selection.
I shared this with a coworker, who discovered that it dumps information about branches that don't exist anymore. This comment's alternate command doesn't list deleted branches:
And for those wondering "deleted branches?", check the git-gc man page for gc.reflogexpire (default 90 days) and gc.reflogexpireunreachable (default 30 days).
I had idea to add something similar as tab completion to posh-git module for Powershell. Sadly it was not merged (is posh-git dead?) https://github.com/dahlbyk/posh-git/pull/641
I wonder if something similar can be done in bash? By default bash doesn't "cycle" through possible completion but just display the list. Still, I guess it would be usefull to display last used branches first.