Sort branches by last commit date
ryangreenberg.com
Sort branches by last commit date
1–10 of 56 posts
Re: Sort branches by last commit date
#2Even better (IMHO!) is `git config branch.sort -committerdate` (note the `-`). This will sort newest committer date first.
Re: Sort branches by last commit date
#3Even better (IMHO!) is `git config branch.sort -committerdate` (note the `-`). This will sort newest committer date first.
I have this as an alias in my .zshrc!! Very handy
Re: Sort branches by last commit date
#4Or just have `jj log` custom-configured.
Re: Sort branches by last commit date
#5FYI/fwiw Fish shell autocompletes branches sorted by last commit date when writing out git commands. It also provides completions for commitish objects grouped by class, giving precedence to the usual targets first, with each group sorted by its own sort key. Handy!
Re: Sort branches by last commit date
#6How many branches would you need to have to make this worthwhile?
Re: Sort branches by last commit date
#7How many branches would you need to have to make this worthwhile?
At any time I'm working across 5-30 branches (some when I'm reviewing other folks' code) so it's handy to see my latest branches
Re: Sort branches by last commit date
#8I just click on tower and open it, much better
Re: Sort branches by last commit date
#9How many branches would you need to have to make this worthwhile?
I've seen monorepos with over 10k active branches. But even at a smaller scale (10-100 branches), it becomes useful when manually stacking and/or rebasing, especially if you have a smaller terminal.
Re: Sort branches by last commit date
#10I love this little fzf bash function that I wrote a few years ago: https://gist.github.com/thomasaarholt/141df779f3f16b641701b4...
It opens a fuzzy finder window showing the branches you have in the repo, sorted by recency. Also shows the latest committer and the date. Hit enter on the one you want to swap to it.