title: "Git Commit Generation"
Generate descriptive commit messages automatically based on your staged git changes. Kilo Code analyzes your staged files and creates conventional commit messages that follow best practices.
{% callout type="info" %}
This feature only analyzes staged changes. Make sure to stage your files using git add or via VS Code interface before generating commit messages.
{% /callout %}
The git commit message generator:
git add or the VS Code git interfaceKilo Code logo next to the commit message field)The generated message will appear in the commit message field, ready for you to review and modify if needed.
{% image src="/docs/img/git-commit-generation/git-commit-1.png" alt="Generated commit message example" width="600" /%}
By default, generated messages follow the Conventional Commits specification:
<type>(<scope>): <description>
<body>
Common types include:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksYou can customize how commit messages are generated by modifying the prompt template:
PromptsPrompt template to match your project's conventions{% image src="/docs/img/git-commit-generation/git-commit-2.png" alt="Commit message generation settings" width="600" /%}
The default template creates conventional commit messages, but you can modify it to:
You can configure which API profile to use for commit message generation:
Prompts settings, scroll to "API Configuration"{% callout type="tip" %} Consider creating a dedicated API configuration profile with a faster, more cost-effective model specifically for commit message generation. {% /callout %}
git add -p for partial file staging when neededHere are examples of messages the feature might generate:
feat(auth): add OAuth2 integration with Google
Implement Google OAuth2 authentication flow including:
- OAuth2 client configuration
- User profile retrieval
- Token refresh mechanism
fix(api): resolve race condition in user data fetching
Add proper error handling and retry logic to prevent
concurrent requests from causing data inconsistency
docs(readme): update installation instructions
Add missing dependency requirements and clarify
setup steps for new contributors
If the button doesn't appear or generation fails, ensure you have staged changes:
git add <files>
# or stage all changes
git add .
If generated messages aren't helpful:
The feature integrates with VS Code's built-in git functionality. If you encounter issues: