0

I'm setting up a new machine as a development environment. When I type git branch the branches arn't in alphabetical order, which I've never seen before.

What are the possible causes of this? I know I havn't provided much information but I'm not sure how to start debugging this.

Evanss
  • 23,390
  • 94
  • 282
  • 505
  • Do you have a sample of the non-alphabetically sorted output you get? – Romain Valeri Oct 28 '21 at 15:25
  • Im afraid I cant share this for security reasons. Might sound paranoid but my work is very strict. – Evanss Oct 28 '21 at 15:31
  • 1
    You may want to check the configuration file stored in the repo if there is one: https://git-scm.com/docs/git-config – Jonathon S. Oct 28 '21 at 15:35
  • 1
    There are some details here that might help you to resort when using the branch command: https://stackoverflow.com/questions/14273531/how-to-sort-git-tags-by-version-string-order-of-form-rc-x-y-z-w. – Jonathon S. Oct 28 '21 at 15:35
  • Two different machines are outputting `git branch` order differently? Are those two machines the same OS? Is the difference related to upper vs lowercase letters? – TTT Oct 28 '21 at 16:27
  • Are there slashes in your branch names? – Alex028502 Oct 28 '21 at 18:05
  • Note: the linked question is about sorting tags, but you can sort branch names the same way, as branch names, tag names, and all other names in Git use a single common underlying mechanism. – torek Oct 29 '21 at 00:58
  • The default sort order is "alphabetical as determined by the locale" (see [here](https://unix.stackexchange.com/q/75341/162084)), so it's possible you have different collation orders on the two systems. – torek Oct 29 '21 at 01:35
  • @Alex028502 yes some names start with _ – Evanss Oct 29 '21 at 08:10

0 Answers0