Copy Branch Name for Visual Studio
Download this extension from the Visual Studio Marketplace or get the latest CI build from Open VSIX Gallery. Pasting a branch name into a pull request, a ticket or a chat shouldn't mean retyping
What You GetOne shortcut - Press Ctrl+Shift+Alt+B anywhere in Visual Studio to copy the current branch. Right where Git already lives - Copy Branch Name sits next to New Branch and Manage Branches in the Git menu, in the Git submenu when you right-click in the editor or Solution Explorer, in the Git Changes window's ... menu, and on document tabs next to Copy Full Path. Any branch, not just the current one - Right-click a branch in the Git Repository window or in the branch picker to copy that branch's name. Multi-repository aware - Copies the branch of the repository you're working in: the item selected in Solution Explorer, otherwise the active document, otherwise the solution. Out of the way - The command only shows up while a Git repository is open. Copy Any BranchRight-click a branch in the Branches pane of the Git Repository window, or in the branch picker you open from the status bar or the Git Changes window, and choose Copy Branch Name. Remote branches are copied as shown, for example
Keyboard Shortcut
Rebind it under Tools > Options > Environment > Keyboard by searching for Which Branch Gets CopiedThe status bar confirms what was copied, for example Copied Git branch name 'feature/1203-dark-theme' to the clipboard (Contoso.Web). The repository is picked in this order:
Special cases:
How It WorksThe current branch is read straight from the repository's Visual Studio doesn't tell extensions which branch row was right-clicked, so the branch-row entry reads the row under the mouse through internal Visual Studio members. If a future Visual Studio update changes them, that one menu entry disappears and everything else keeps working. To catch the very first right-click, the extension loads in the background once a repository is open. Supports Visual Studio 2022 (17.0 and later) and Visual Studio 2026. ContributeIssues, ideas, and pull requests are welcome. Open |


