Sortable Git Branches for Visual Studio
A dockable Tool Window version for Visual Studio 2022 / 2026.
This extension does not replace the standard Git branch list. Instead, it adds a dedicated Sortable Git Branches tool window inside Visual Studio.
Final User Experience
- Displayed as a dockable Tool Window inside Visual Studio
- Can be opened from
View → Other Windows → Sortable Git Branches
- Can be opened with one click from a button on the standard toolbar
- Can also be opened with
Ctrl + Alt + G
- Configured to dock near Solution Explorer
- Displays branches sorted by latest commit date in descending order
- Search box filters by branch name, commit message, and commit ID
- If GitHub CLI is logged in, open Pull Requests are displayed in the PR column, and PRs requesting your review are highlighted
- Pull Request GitHub pages can be opened from the PR column
- Checkout by double-clicking or pressing Enter. A warning is shown if there are uncommitted changes
- Select a target branch from the toolbar, and branch names already included in that target branch are subtly color-coded
- Regardless of whether a PR exists, the selected branch can be merged locally into the target branch
- Before merging, a GitHub Pull Request-style confirmation dialog is displayed
Create a merge commit / Squash and merge can be selected, and the commit title and body can be reviewed
- For Refresh,
git fetch --prune and GitHub CLI PR information retrieval can be configured in Settings as Ask each time / Always / Never
- UI text supports English and Japanese. Settings allow switching between Auto / English / Japanese
- Branch type labels and relative timestamps also switch according to the display language
- Git output is read as UTF-8 to support Japanese branch names
- No cmd / PowerShell console window is shown
Supported Visual Studio Versions
- Visual Studio 2022
- Visual Studio 2026
source.extension.vsixmanifest targets Visual Studio 17.x or later.
Requirements
The build machine requires the following:
- Visual Studio 2022 or Visual Studio 2026
- Visual Studio extension development workload in Visual Studio Installer
- Git for Windows
- GitHub CLI (
gh) and gh auth login if you want to display Pull Requests
- An environment where NuGet restore is available
Build
Run the following command in the folder where the ZIP was extracted:
pwsh -NoProfile -File .\build-release.ps1
You can also run it with Windows PowerShell:
powershell.exe -ExecutionPolicy Bypass -File .\build-release.ps1
The generated VSIX will be output to:
src\SortableGitBranches\bin\Release
build-release.ps1 automatically updates the VSIX version before building. If the extension is already installed, running the newly built VSIX will overwrite it as an update.
Installation
- Close Visual Studio
- Double-click the generated
.vsix
- Select Visual Studio 2022 / 2026 and install it
- Start Visual Studio
Usage
You can open it in one of the following ways:
View → Other Windows → Sortable Git Branches
Or:
Sortable Git Branches button on the standard toolbar
Or:
Ctrl + Alt + G
Once the branch list is displayed, double-click a branch or press Enter to checkout that branch.
In a GitHub repository where GitHub CLI is installed and logged in, open Pull Requests on GitHub are displayed in the PR column as number links such as #123. Pull Requests requesting your review are highlighted with color and bold text. Clicking the PR display opens the GitHub Pull Request page.
At the top of the screen, use “Target branch (Base)” to select the branch that will receive the Merge / Squash. The row selected in the branch list becomes the “source branch to merge”. If Git history shows that the tip commit of that branch is already contained in the target branch, the branch name is subtly color-coded, and the status is also shown in the tooltip. Because squash merges cannot be fully determined from normal Git history alone, the UI does not display a definitive column for squash-merged status.
Merge / Squash
- Select the “source branch to merge” from the branch list.
- Select the “target branch” at the top of the screen.
- Click Merge / Squash...
- In the dialog, review the source branch, target branch, merge method, commit message, and whether to update the target branch first using
git pull --ff-only.
- Execute the operation.
To prevent accidental operation, branches cannot be changed inside the dialog. The source branch is fixed to the branch selected in the list, and local branches and remote branches are distinguished, such as feature/login / origin/feature/login. The target branch is remembered per selected branch and per repository. Pull Request base branches, origin/HEAD, and GitHub’s default branch are also included as candidates. This feature performs only local Git operations. It does not push to GitHub or close Pull Requests.
Localization
Buttons, column names, settings screens, confirmation dialogs, and error messages in the tool window support English and Japanese.
Settings → Display language → Auto / English / Japanese
Auto displays Japanese when the Visual Studio / OS UI culture is Japanese; otherwise, it displays English. The language setting is saved in Visual Studio user settings.
Notes
The initial display position depends on the current Visual Studio layout state. If the docking position is not applied correctly, reset the layout from Window → Reset Window Layout, and then open the tool window again.
License
MIT License.
Security and Safety Notes
This extension does not collect its own telemetry and does not store GitHub credentials. Pull Request display calls GitHub CLI (gh) only when it is installed and authenticated.
Merge / Squash requires a clean working tree and displays a confirmation dialog before execution. Even after a successful operation, it does not automatically push. Review the created local commit first, and push manually if necessary. Branches associated with draft Pull Requests are not treated as normal merge targets, similar to GitHub behavior, and a warning is shown.
This extension performs only local Git operations. It does not enforce branch protection rules or required status checks on GitHub.
When git fetch --prune is executed during Refresh, confirmation is handled according to Settings. If set to Ask each time, the Yes / No result is not saved, and confirmation will be shown again next time. This communicates with the remote and prunes deleted remote-tracking branches from the local cache, but it does not delete local branches.