'Is there a way to sort Source Control Providers in VS Code?
I work with multiple Git repositories at once (30+ sometimes) in VS Code.
Currently it's very difficult to visually find a specific repo in the Source Control section of VS Code. I can't figure out how the repo list is sorted. It's not alphabetical, neither is it based on how recently updates to files were made. The order seems to be random. Well, it's somewhat sorted but in a way that makes it useless.
(I'm not showing full names for privacy concerns, but you can see the very first item in the screenshot is out of order)
The Explorer view is fine - there's a way to control the order of files and folders through settings and everything is sorted correctly. However, for the Source Control view I was unable to find anything.
Is this a missing feature, or a bug perhaps? Or is there a setting I haven't found yet?
- macOS 10.14
- VSCode 1.27.2
Solution 1:[1]
I am using VS Code 1.42.1 on Windows x64 and am experiencing the same issue. The list of Git repos in SCM is not sorted alphabetically. I found a solution to sort my repos in the same order as in explorer (alphabetical). Open settings > Features > SCM and set Providers: Visible to 0 (this will show all repos after you drag the window manually) Open Settings > Extensions > Git and - set Auto Repository Detection to subFolders - Add your folder path to Scan repositories (I use only one main folder for all repos) Go to Source Control and close all your repos by right-click > Close Repository one by one Then close VS Code and restart it. Your repos should be automatically discovered and listed alphabetically. It might be that is it enough to Close Repository and simply restart VS Code as it seems to scan for repos every time at startup.
Solution 2:[2]
It looks like sorting SCM repositories alphabetically will be the default in v1.66 - I don't see a setting to enable/disable in the commit.
See Commit: SCM - Sort repositories by name
And in v1.67 more sorting options are added:
This milestone we have introduced a new setting,
scm.repositories.sortOrder
, to control the default sort order of the repositories displayed in the Source Control Repositories view. Repositories can be sorted by the order in which they are discovered, by name, and by full path. Changing the sort order can be done using the ... Views and More Actions menu of the Source Control Repositories view and the ... > View & Sort > Repositories menu of the Source Control view.
Setting:
Repositories: Sort Order
Options:
discovery time
name
path
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ludovic Pochon-Guerin |
Solution 2 |