by ses4j on 4/6/20, 6:53 PM with 23 comments
by petepete on 4/6/20, 8:20 PM
git branch --sort=-committerdate -v
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
by amarshall on 4/7/20, 1:37 AM
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.
Maybe someone will find it useful as I have.
by telekid on 4/6/20, 9:47 PM
by floatingatoll on 4/6/20, 10:15 PM
https://news.ycombinator.com/item?id=22797911
And for those wondering "deleted branches?", check the git-gc man page for gc.reflogexpire (default 90 days) and gc.reflogexpireunreachable (default 30 days).
by kbd on 4/7/20, 12:29 AM
https://github.com/kbd/setup/blob/f3ebd5ef2bc8a010357b574c02...
by jph on 4/6/20, 11:45 PM
git for-each-ref
--sort=-committerdate
--format='%(committerdate:short) %(refname:short) %(objectname:short) %(contents:subject)'
refs/heads/
The output shows the date, branch name, commit hash, and commit subject, such as: 2020-04-06 master d8560f4 Add feature foo
2020-03-28 fix-button 15f985d Fix button for menu
2020-03-19 optimize-sort 3dbec4d Optimize sort algorithm
I put my aliases in GitAlias, which has many more: https://github.com/gitalias/gitaliasby bhaak on 4/7/20, 11:32 AM
https://github.com/bhaak/dotfiles/blob/master/git/git-overvi...
It has been so useful to me that I think I should extract it from my dotfiles repository and give it its own repository.
Or reimplement it in Rust as a introductory programming project.
by mpawelski on 4/6/20, 10:18 PM
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.
by memco on 4/7/20, 2:09 AM
by alpb on 4/7/20, 12:55 AM
alias gbv="git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objec tname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
by whalesalad on 4/7/20, 2:58 AM
https://github.com/whalesalad/dotfiles/blob/master/zsh/git.z...
by grumple on 4/6/20, 11:47 PM
The most recent branches will appear closest to your cursor (on the bottom).
by jilles on 4/7/20, 1:06 AM
by ryanpetrich on 4/6/20, 10:28 PM
git log --all --author=`git config user.email` --oneline --decorate