Edit commit messages via VS Code's editor and Autocomplete for Conventional Commits.
- Supports to edit commit messages via VS Code's editor
- See details below
- Supports IntelliSense to edit commit messages that conform to Conventional Commits Specification
- Auto Completions
- Commit Types completion
- Scopes completion
- Includes Workspace level user scopes management
- Supports auto grepping the scopes from existing commit history
- Gitmojis completion
- Footer Types completion
- Issues completion for the Footer Type
Closes
- Commits completion for the Footer Type
Refs
- Hovers
- Over
Type
,Scope
, andEmojis
of the Summary line - Over
Type
,Issues
, andCommits
of the Footer lines
- Over
- See details below
- Auto Completions
- Selecting the previous commit message by
Recent commits...
CodeLens link- See details below
To install this extension go to View > Extensions and search for git-commit-message-editor
. Next click Install and then Reload.
You can open the commit message editor by clicking the Edit icon in the repository in the Source Control view.
Or select Open Commit Message Editor from the overflow menu in the repository in the Source Control view.
Or launch Git: Open Commit Message Editor command on the Command Palette.
Type commit messages with IntelliSense feature and then save it. The Source Control Input Box be filled with the message you typed.
If you don't want to close the commit message editor window after saving, change gitCommitMessageEditor.editor.keepAfterSave
option to true
. Note that auto-focusing to the Source Control view only works with the option is false
.
Note: The commit message editor does not actually create a
workspace/.git/COMMIT_EDITMSG
file. The file IO operations are handled by the VFS (Virtual File System).
You can trigger IntelliSense in the commit message editor window by typing Ctrl+Space, or by typing the letters.
Also supported in the VS Code as Git editor mode.
All completions conform to Conventional Commits Specification.
List of available conventional commit types:
Commit types originally from commitizen/cz-conventional-changelog
Type | Title | Description |
---|---|---|
feat | Features | A new feature |
fix | Bug Fixes | A bug fix |
docs | Documentation | Documentation only changes |
style | Styles | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
refactor | Code Refactoring | A code change that neither fixes a bug nor adds a feature |
perf | Performance Improvements | A code change that improves performance |
test | Tests | Adding missing tests or correcting existing tests |
build | Builds | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
ci | Continuous Integrations | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
chore | Chores | Other changes that don't modify src or test files |
revert | Reverts | Reverts a previous commit |
wip | Work In Progress | A commit that will be squashed later |
initial | Initial | Initial commit |
You can type a scope manually, select one that is saved, or create a new scope by selecting the Create New Scope
item in the suggestion list.
Note: If
gitCommitMessageEditor.intelliSense.completion.logScopes.enabled
option istrue
, the scope suggestion list also includes the parsed scopes from existing commit history.
The scope allows only words, underscores, hyphens, and dots (can optionally begin with $) and will be saved into workspace/.vscode/settings.json
.
Check out available emojis on Gitmoji
You can trigger the gitmoji suggestions by typing a trigger character :
(colon).
The gitmojis completion only works in the subject section of the summary and offers the gitmoji suggestions by Commit Type
that you typed. If you want to show all gitmoji suggestions, cancel (pressing Esc) the suggestions widget and re-trigger by typing Ctrl+Space follow the :
(colon).
Also supports the footer type completion.
List of available conventional footer types:
Type | Title | Description |
---|---|---|
Closes | Referencing issues | A code change that related issues to close (for example, Closes #133) |
Refs | Referencing commits | A code change that related other commits (for example, Refs: 676104e, a215868) |
BREAKING CHANGE | Breaking changes | A code change that causes other features to fail |
You can trigger the issue suggestions by selecting the Closes
item in the footer type suggestion list, or by typing a trigger character #
(number sign) on the Closes
footer line.
The issue suggestions are provided from your remote git hosting service. The issue items suggested are cached, and the caches will be cleared when the editor closed.
Currently, you can use the git hosting service GitHub only. Note that GitHub API allows for up to 60 requests (for fetching issues) per hour. If you'd like to get a higher GitHub API rate limit, you can authenticate with the GitHub authentication (built-in) extension. See GitHub API Rate limiting for more information.
You can trigger the commit suggestions by selecting the Refs
item in the footer type suggestion list, or by typing Ctrl+Space on the Refs
footer line.
The commit suggestions are provided from your local repository.
You can hover over that Type
, Scope
, and Emojis
of the Summary line and Type
, Issues
, and Commits
of the Footer lines.
To select the previous commit message, click the Recent commits...
CodeLens link.
Or use the keyboard shortcut Ctrl+Shift+'.
The CodeLens link will appear only when no commit message is typed.
Table of contributed settings (prefix "gitCommitMessageEditor."):
Name | Default | Description |
---|---|---|
editor.keepAfterSave | false |
Controls whether the commit message editor tab keep or close, after saving |
codeLens.recentCommits.enabled | true |
Controls whether the Recent commits... code lens feature is enabled or not |
codeLens.recentCommits.maxItems | 32 |
Specifies the maximum number of commits to show in the quick pick UI |
intelliSense.completion.enabled | true |
Controls whether the "Quick suggestions" feature is enabled or not |
intelliSense.completion.scopes | [] |
Scopes that user created (Scopes will be saved into workspace/.vscode/settings.json ) |
intelliSense.completion.logScopes.enabled | false |
Controls whether the scope suggestions include or not the parsed scopes from existing commit history |
intelliSense.completion.issues.pageSize | 20 |
Specifies the maximum number of issues per page to show in the suggestions widget |
intelliSense.hover.enabled | true |
Controls whether the "Hover" feature is enabled or not |
And recommends adding a setting below into your Global or Workspace settings.json
, if you want to follow the Git 50/72 rule.
"[git-commit]": {
"editor.rulers": [
50,
72
]
}
If you find any problems using this extension, or you want to propose new features to it, feel free to open an issue on GitHub.
Detailed Release Notes are available here or above Changelog tab.
Icon made by Freepik from www.flaticon.com