> ## Documentation Index
> Fetch the complete documentation index at: https://kiro.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Source Control

> Manage Git operations with AI-powered commit message generation and comprehensive version control features

Kiro's Source Control view provides comprehensive Git integration with AI-enhanced features to streamline your version control workflow.

## Commit message generation

Kiro generates a commit message from your changes. If you have staged changes, the message describes only what is staged. If nothing is staged, the message describes the changes in your working tree, including the contents of new untracked files, and Kiro tells you so: **Nothing is staged, so the commit message describes all changes**. Large change sets are truncated before Kiro reads them, so stage a focused set when completeness matters.

[Video](https://kiro.dev/videos/git-commit-message.mp4)

### How to generate commit messages

1. Stage the changes you want to commit. Or leave everything unstaged to describe your working-tree changes.
2. Select the 🪄 button next to the commit message field.
3. Review the generated message. Kiro analyzes your changes and creates a draft.
4. Edit the message if needed.
5. Commit your changes using the generated or edited message.

**Tip:** You can set up a custom keyboard shortcut for `Kiro: Generate Commit Message` in your keyboard settings for faster access.

### What Kiro reads

- Files excluded by your ignore rules are left out by name and content. Kiro reports how many changed files it left out. If every changed file is excluded, Kiro tells you that no message was generated.
- If an excluded file is a tracked file, Kiro withholds the diff for all tracked changes and describes the remaining tracked files by name and status only. Untracked files are still described with their content.
- Untracked files are described as new files with their content. Binary files and files larger than 1 MB are listed by name without their content.
- Kiro reads at most 8,000 characters of changes. Beyond that, the diff is cut off and marked as truncated, so later changes may not be described.
- If Kiro cannot read the repository's changes, it reports the reason instead of saying there are no changes.
- If there are no changes at all, Kiro says **There are no changes to generate a commit message from**.

### Message format

Kiro follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format with detailed body sections:

```
<type>(<scope>): <subject>

- First change or addition
- Second change or improvement
- Third change if applicable
- Why this change was needed (if relevant)
```

### Conventional commit types

- **feat**: New features
- **fix**: Bug fixes
- **docs**: Documentation changes
- **style**: Formatting changes
- **refactor**: Code restructuring
- **test**: Adding/updating tests
- **chore**: Maintenance tasks
- **perf**: Performance improvements
- **ci**: CI/CD changes

### Example

```
feat(docs): add comprehensive Source Control documentation
- Create new documentation page for Source Control features
- Update interface documentation to link to Source Control page
- Provide detailed explanation of AI-powered commit message generation
- Describe diff context provider and commit message generation process
```

## Git diff context provider

You can include your current git changes in any chat conversation by typing `#Git Diff`. This allows Kiro to see your staged and unstaged changes, making it easier to get contextual help with your modifications.

### Example usage

```
Hey Kiro, can you fix the merge conflicts? #Git Diff
```

## Troubleshooting

### Git operations failing

- Check your Git configuration and credentials
- Ensure you have proper permissions for the repository
