Our team's `git branch` output is a graveyard. Sorting by last commit would be a godsend for quickly identifying active work and stale branches.
Sort branches by last commit date
21–30 of 56 posts
Re: Sort branches by last commit date
#22Even 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.
Re: Sort branches by last commit date
#23[deleted]
Re: Sort branches by last commit date
#24Let's sort git branches by quality, better branches towards the top, slop at the bottom.
Re: Sort branches by last commit date
#25The best upgrade to these kinds of git branch scripts is piping them to fzf. I’ve been using this fbr one from the fzf repo. https://github.com/jbranchaud/dotfiles/blob/main/zshrc.local...
Re: Sort branches by last commit date
#26Amazing what one can learn from rtfm
Re: Sort branches by last commit date
#27TIL Git can do this without a shell script. I’ve been manually sorting through branches like an idiot
Re: Sort branches by last commit date
#28Nice. Will help solve some mysteries on older projects.
Re: Sort branches by last commit date
#29I 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