question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sort all branches by last update

See original GitHub issue

Is your feature request related to a problem? Please describe.

Showing recent branches is a great feature, but I often have trouble finding a fairly recent branch because it’s disappeared from the short “Recent Branches” list.

Describe the solution you’d like

Divide the list of branches into “Local Branches” (sorted by date) and “Remote Branches” (sorted by date), instead of “Recent Branches” (sorted by date) and “Other Branches” (sorted alphabetically).

It’s not very useful to have branches sorted alphabetically, as you can already type to filter them.

Describe alternatives you’ve considered

Switching to the command line and using a custom git branches alias:

for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'

Teachability, Documentation, Adoption, Migration Strategy

This would replace the current dropdown list of branches.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
teadrinkercommented, Mar 13, 2022

The way I perceive recent, is “locally recent” - which branches I have actually recently used/switched to, on this machine). I think this functionality is fine, and I don’t need more than 3 of these for my own usage.

However, it is very annoying that I cannot see new branches that have been added remotely (we have a lot of branches). For this issue, I would suggest a selection of sorting (Name or Date), ideally this option is global, and saved automatically with app settings.

dropdown

2reactions
jcushmancommented, Nov 23, 2020

I’ll just add another user story for this feature. I often use “recent branches” to switch between the last few branches when I’m working on a couple of things at once. But if I start working on something and then move away for a little longer, I’ll have to do something like git for-each-ref --sort=-committerdate refs/heads/ | less to find it again because the list only has five items. “Other branches” has hundreds of branches and doesn’t serve any use for me when ordered alphabetically.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get a list of Git branches, ordered by most recent ...
To list remote branches, use git branch -r --sort=objectsize . The -r flag causes it to list remote branches instead of local branches....
Read more >
View branches sorted by date - Git - 30 seconds of code
Use git branch --sort=-committerdate to display a list of all local branches and sort them based on the date of their last commit....
Read more >
List remote Git branches and the last commit date for ... - GitHub
List remote Git branches and the last commit date for each branch. Sort by most recent commit date. - git-branches-by-commit-date.sh.
Read more >
Sort git Branches by Date - David Walsh Blog
You can also just do git branch --sort=-committerdate to get the local branches with the most recently committed to on top. Viktor. Also,...
Read more >
git-branch Documentation - Git
Sort based on the key given. Prefix - to sort in descending order of the value. You may use the --sort=<key> option multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found