Git alias for printing recently-used branches
ses4j.github.io
Git alias for printing recently-used branches
1–10 of 25 posts
Re: Git alias for printing recently-used branches
#2 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 inputsRe: Git alias for printing recently-used branches
#3I alias 'git recent' to: 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
git branch -a --sort=-committerdate
That's short enough for my taste not to have to alias, and it gives output more or less similar to GitHub's "Active branches" view.Re: Git alias for printing recently-used branches
#4I alias 'git recent' to: 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
git for-each-ref --sort=-committerdate --format='%(committerdate:short): %(refname:short)' refs/heads/
Including the dates is crucial; I'll frequently go in and clean up personal branches that are older than X months.Re: Git alias for printing recently-used branches
#5Re: Git alias for printing recently-used branches
#6I alias 'git recent' to: 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
Re: Git alias for printing recently-used branches
#7Re: Git alias for printing recently-used branches
#8https://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).
Re: Git alias for printing recently-used branches
#9I 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.
Re: Git alias for printing recently-used branches
#10 git log --all --author=`git config user.email` --oneline --decorate