Skip to content

Sort all branches by last update #5155

Open

Description

@hubgit

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.

Activity

  1. shiftkey commented on Jul 17, 2018

    @shiftkey
    Member

    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.

    I'm actually more interested in this part of the issue than changing the sorting, because I've spent a bit of time in there thinking about how it works.

    I think the core of your problem is that we don't consider whether a branch exists in the list when we're reading the reflog. I can see this in my local Desktop clone after pruning some merge branches:

    Are you pruning your merged branches? I think the fact that our getRecentBranches function here doesn't confirm a branch exists locally mean we can end up often showing fewer branches than the 5 allowed.

    export async function getRecentBranches(
    repository: Repository,
    limit: number
    ): Promise<ReadonlyArray<string>> {

  2. added
    more-info-needed
    on Jul 17, 2018
  3. self-assigned this
    on Jul 23, 2018
  4. hubgit commented on Jul 25, 2018

    @hubgit
    ContributorAuthor

    Are you pruning your merged branches? I think the fact that our getRecentBranches function here doesn't confirm a branch exists locally mean we can end up often showing fewer branches than the 5 allowed.

    The remote branches are being deleted when they're merged, but the local branches aren't being pruned. Does the list take account of which branches are in the origin repository and which have been merged, or is it literally just the most recently-edited local branches?

    If I run the git branches alias that's in the issue description, I can see 5 local branches edited in the last 24hr, but GitHub Desktop only shows 4 of them (+ master).

    There could easily be more than 5 branches edited in the last 24hr, as well.

    I'm interested to know when it's useful to have branches listed in alphabetical order, rather than by date.

  5. shiftkey commented on Jul 25, 2018

    @shiftkey
    Member

    @hubgit thanks for the extra details

    Does the list take account of which branches are in the origin repository and which have been merged, or is it literally just the most recently-edited local branches?

    No, the code has zero context on the actual branch details and just walks the reflog to find the N most recent branches that were checked out locally. This is what we consider "recent" - branches that you've checked out locally, and we don't look at the most recent commit to each branch.

    I can see 5 local branches edited in the last 24hr, but GitHub Desktop only shows 4 of them (+ master).

    This makes sense - we mark master as the default branch, so it gets listed before these recent branches and we show one fewer.

    I'm interested to know when it's useful to have branches listed in alphabetical order, rather than by date.

    This is mostly just mirroring the defaults of git branch

  6. added
    user-research
    and removed
    more-info-needed
    on Jul 25, 2018
  7. shiftkey commented on Jul 25, 2018

    @shiftkey
    Member

    @billygriffin would love your thoughts on two related questions here:

    • the recent branches list - using the reflog or looking at the most recent commit timestamp? We've gone with the former option because that felt more focused on you, but if you're in a more collaborative situation using the commit timestamp means you might able to keep up with activity from collaborators

    • sorting the branch list - alphabetical versus date? Do we follow Git here and list alphabetically in a predictable way, or would seeing up-to-date branches be helpful for finding things in some situations?

  8. billygriffin commented on Jul 27, 2018

    @billygriffin
    Contributor

    @shiftkey @hubgit Thanks for clarifying this, and sorry for the delay in responding. The potential for misaligned expectations vs what's actually presented makes total sense. I added this to our research list (and the label is helpful in reinforcing that). I don't see it as insanely high priority, but definitely worth examination in the next few months as we dig into usability more generally.

    I think there are two things here:

    1. We should choose whatever patterns are most useful to people, which I think we've attempted to do but may need to re-evaluate with observing people using the app.

    2. Whatever we do arrive at, we should make sure the words we use to communicate them match people's expectations. So in this case, we say "Recent branches", but if "recent" means different things to different people, we need to choose clearer language.

    Also want to make sure @ampinsk and @donokuda have visibility on this.

  9. removed their assignment
    on Aug 1, 2018
  10. oguzyildizz commented on Jun 28, 2019

    @oguzyildizz

    It would be also great if I could increase the number of recent branches displayed in there. Once a branch I'm trying to get is 6th most recent one, finding it takes a bit time

  11. outofambit commented on Jul 1, 2019

    @outofambit
    Contributor

    Thanks for the bump here @oguzyildiz1991 ! There's another conversation happening in #7755 that I've linked this issue to.

  12. jcushman commented on Nov 23, 2020

    @jcushman

    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.

  13. oguzyildizz commented on Nov 23, 2020

    @oguzyildizz

    Exactly. If you're working on 5 branches it's alright, but once you're looking for the 6th most recent branch, suddenly you gotta go on an adventure

  14. steveward commented on Oct 18, 2021

    @steveward
    Contributor

    In #13105 it was brought up that remote branches do not appear in the Recent branches list. Showing them would align with what was mentioned in #5155 (comment):

    but if you're in a more collaborative situation using the commit timestamp means you might able to keep up with activity from collaborators

  15. 7 remaining items

  16. tidy-dev commented on Oct 21, 2025

    @tidy-dev
    Contributor

    From #21132

    Would be great if we ha a visual information (a red background or any color else) of the last branch commited by date.
    Add a color in the background of the last item commited by date.

  17. marked Branch Dropdown Organization #21200 as a duplicate of this issue on Nov 3, 2025
  18. msawired commented on Nov 4, 2025

    @msawired

    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

    on another ticket, I also suggested the exact solution. Adding an option to change ordering alphabetical vs. date in Other Brances would solve lots of problems mentioned here: Would help finding "other" recent branches not displayed in "recent branches", and it would also help notice and clean stalled branches.

  19. metasidd commented on Apr 13, 2026

    @metasidd

    Love that solution @msawired . I believe this would be helpful even after a user types in a search query. Given that projects can have thousands of branches (open and closed), I'd love to see it sorted by last updated.

  20. greegus commented on Apr 29, 2026

    @greegus

    This feature is so needed – once you work with more than a few branches that you checkout between often, it's practically impossible with this app to get to one without knowing an exact name.

    The sorting of the unfiltered (no search query) list of branched just doesn't make ANY sense to me. WHY would anybody want to see a 2-year-old branch in front of a 3-month-old one, followed by a 9-month-old one, when trying to check out last week's work?! It's not even alphabetically sorted. Literally counterproductive.

  21. adesai1000 commented on Sep 21, 2026

    @adesai1000

    For anyone still waiting on this since 2018: my fork, GlitchHub Desktop, adds it. Settings > Appearance > Branch List has "Sort other branches by" with a "Last update, newest first" option. The Default and Recent groups keep working the way they do today; the long tail of other branches is what gets sorted by the tip commit date. You can also right-click any branch to pin it to the top of the list.

    Not affiliated with GitHub. macOS on Apple silicon only for now, unsigned build, so right-click and Open the first time. Separate profile folder, so it lives happily next to GitHub Desktop.

    Download: https://github.com/adesai1000/GlitchHub-Desktop/releases/latest

    If it is useful, a star on the repo would help other people here find it.

  22. added a commit that references this issue on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    skip-pitchuser-research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions