Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Auto Commit Message PrefixNew to Visual Studio Code? Get it now.
Auto Commit Message Prefix

Auto Commit Message Prefix

Peter Frandsen

|
1,034 installs
| (1) | Free
A VS Code extension to extract substring from git branch name (e.g., Jira issue) and insert it as prefix to commit message.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Auto Commit Message Prefix

A VS Code extension to extract substring from git branch name (e.g., Jira issue) and insert it as prefix to commit message.

Features

Click the extension's button in the Git pane will add a substring from the branch name as prefix in the commit message input field. The default regular expression used to find the substring uses the pattern in Bitbucket/Jira branch names to extract the Jira issue identifier.

  • Commit message for branch "feature/JIRA-42-abc" will get "JIRA-42 " as prefix when the extensions Git pane button is clicked and the default configuration is used.

Extension Settings

This extension contributes the following settings:

  • autocommitmessageprefix.pattern: Used to override the default regular expression used for matching substring in branch name.
  • autocommitmessageprefix.prefix: Fixed prefix text (default '') added in front of the matched text from the branch name.
  • autocommitmessageprefix.postfix: Fixed postfix text (default '') added after the matched text from the branch name.
  • autocommitmessageprefix.spaceafter: If true (default) the extension will insert a space if there is no whitespace between prefix and commit message.

Keyboard Shortcut

The extension can be activated using

  • Linux/Windows: Control+Alt+p
  • Mac: Shift+Command+p

To change shortcut:

  • Linux/Windows: File > Preferences > Keyboard Shortcuts
  • Mac: Code > Preferences > Keyboard Shortcuts

Installation

Go to the Marketplace link below and click the Install button.

VS Code Marketplace - Auto Commit Message Prefix

Usage

  1. Open a VS Code project which is a Git repository.
  2. Edit one or more files and stage them.
  3. In VS Code's Git pane, click the Auto Commit Message Prefix icon (or use the keyboard shortcut).
  4. The extension will create a prefix for the commit message for you in the commit message box.
  5. Add your commit message (the message can also be edited before you click the Auto Commit Message Prefix icon).
  6. Commit - click the tick symbol button, or use the keyboard shortcut Control+Enter / CMD+Enter.

License

Released under MIT by @Peter Frandsen.

See Credit for information about projects that was use as inspiration for this extension.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft