Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Branch NameNew to Visual Studio Code? Get it now.
Copy Branch Name

Copy Branch Name

Philipp Kief

|
5,777 installs
| (7) | Free
| Sponsor
Extension to copy the current branch name
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info


Extension logo

VS Code - Copy Branch Name

Copy the current Git branch name to your clipboard.

Version  Rating  Installs  Downloads

How it works

Status Bar

After installing this extension you will find a new icon in the status bar. As soon as you click on it, the current branch name will be copied to your clipboard so that you can paste it somewhere else in your workflow.

Explanation

Command palette

In addition, it's also possible to run the copy command via VS Code command palette. The command is called Copy current branch name.

Command palette

If the name of the branch was successfully copied to the clipboard, a message text appears in the status bar for a few seconds.

Supported Environments

Works in desktop VS Code and GitHub Codespaces, including Codespaces opened in a browser. The extension runs in the workspace extension host and requires VS Code's built-in Git extension.

Standalone vscode.dev and github.dev are not supported.

Multiple Repositories Support

This extension also supports multiple repositories with intelligent branch detection:

  • When a file is open: The extension automatically copies the branch name from the repository containing the currently active file, ensuring you always get the correct branch name.

  • When no repository matches the active file: If multiple repositories are available, the extension shows a selection dialog with repository names, branches, and paths. This also applies when no file is active. Cancelling the dialog leaves your clipboard unchanged.

  • Single repository: When only one repository is available, the extension automatically uses it without any prompts.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft