Remix.run Logo
password4321 an hour ago

I don't delete branches, I just work with the top several most recently modified.

the_real_cher an hour ago | parent [-]

How to list those? Is there a flag for git branch to sort by recently modified?

(not on my computer right now to check)

rpozarickij an hour ago | parent | next [-]

This isn't exactly the same but I've been using git-recent [0] (with `gr` alias) for many years. It sorts branches based on checkout order (which is what I usually need when switching between branches) and allows to easily choose a branch to checkout to.

[0] https://github.com/paulirish/git-recent

embedding-shape an hour ago | parent | prev [-]

I do `gb` (probably "git branch" when I set that up) which apparently is an alias to `git for-each-ref --sort=-committerdate refs/heads/ --format='%(refname:short)' | tac`, displays a list with the latest changed branch at the bottom. Remove the `| tac` for the reverse order.