Even better (IMHO!) is `git config branch.sort -committerdate` (note the `-`). This will sort newest committer date first.
Even better, "hey, chat GPT, list my branches by commit date." I know that's not a popular answer, but I'm just trying to demonstrate the reality that this kind of knowledge isn't specialized anymore.
Sort branches by last commit date
31–40 of 56 posts
Re: Sort branches by last commit date
#32I have been using something like this for 10+ years by this point - still wonder why it is not default or easier to do than a custom gitconfig/alias hack. :P
> git config branch.sort committerdate
> You can also supply this on a one-off basis as git branch --sort committerdate.
These don't seem like hacks to me. What do you have in mind?
Re: Sort branches by last commit date
#33I have been using something like this for 10+ years by this point - still wonder why it is not default or easier to do than a custom gitconfig/alias hack. :P
Re: Sort branches by last commit date
#34Re: Sort branches by last commit date
#35Re: Sort branches by last commit date
#36Re: Sort branches by last commit date
#37https://github.com/tyre/recent-branches
Enjoy!
Re: Sort branches by last commit date
#38This was one of the better usability changes I made to git, yes you should probably set it for yourself
Re: Sort branches by last commit date
#39Our team's `git branch` output is a graveyard. Sorting by last commit would be a godsend for quickly identifying active work and stale branches.
Re: Sort branches by last commit date
#40This comment gets it correct https://news.ycombinator.com/item?id=49504860
I wrote my own version to do this nearly 10 years ago: https://github.com/amarshall/git-recent-branches