/commit - Create Git Commit
Create a well-formatted git commit following GitLens conventions.
Usage
code
/commit [message]
Commit Message Format
- •Third-person singular present tense: Adds, Fixes, Improves, Updates, Removes, Refactors
- •First line under 72 characters
- •Reference issues with
#123syntax
Examples:
code
Adds support for custom autolinks for Jira - fixes #1234 Fixes graph not rendering when switching repositories Improves performance of commit signature detection Refactors git provider initialization
Workflow
- •Check status:
git status(never use-uall) - •Review changes:
git diff --cachedandgit diff - •Stage files — specific files, not
git add -A - •Generate message if none provided — analyze changes, determine type, draft message, confirm with user
- •Commit using HEREDOC format with Co-Authored-By trailer
- •Verify:
git statusandgit log -1
Pre-commit Hook Failures
- •Do NOT use
--amend(the failed commit never happened — amend would modify the previous commit) - •Fix the reported issues
- •Re-stage fixed files
- •Create a NEW commit
Safety
- •Never use
--forceor--no-verify - •Never amend unless explicitly requested
- •Verify no sensitive files are staged (.env, credentials)