Sort branches by last commit date
11–20 of 56 posts
Huge fan of `git recent` [0] for this purpose.
Re: Sort branches by last commit date
#12Huge fan of `git recent` [0] for this purpose. [0] - https://github.com/paulirish/git-recent
Spoiler it’s fzf under the hood. But it’s perfect and simple.
Re: Sort branches by last commit date
#13Another useful one if you have a large number of tags and want to see the most recently created ones first:
git config --global tag.sort -creatordate
(`-creatordate` reverses the sort so that the newest come first.)Re: Sort branches by last commit date
#14Even better (IMHO!) is `git config branch.sort -committerdate` (note the `-`). This will sort newest committer date first.
`git config --global branch.sort -committerdate`
Re: Sort branches by last commit date
#15How many branches would you need to have to make this worthwhile?
At my current job it's fairly frequent that I have 5+ active branches open for a repo. Not ideal and that's another topic, but it is nice to be able to sort branches because of that.
Re: Sort branches by last commit date
#16Even better (IMHO!) is `git config branch.sort -committerdate` (note the `-`). This will sort newest committer date first.
Rebase an old branch and it suddenly looks recent again. The rewritten tip gets a fresh committer date.
Re: Sort branches by last commit date
#17yep, i have a little helper in my zshrc for this sort of thing:
alias git-hot-refs="git branch --sort=committerdate | tail"
Re: Sort branches by last commit date
#18Feels like the type of problem you could simply choose to not have in the first place (by not using git).
Re: Sort branches by last commit date
#19Even better (IMHO!) is `git config branch.sort -committerdate` (note the `-`). This will sort newest committer date first.
Rebase an old branch and it suddenly looks recent again. The rewritten tip gets a fresh committer date.
Yes. This is what one wants, since if you have recently rebased it, you're clearly doing work with it. Meanwhile, branches you don't care to touch sink to the bottom of the list.
Re: Sort branches by last commit date
#20Such a small quality of life improvement. My `git branch` output is a graveyard sometimes, this would be handy.