How to Use Claude Code with Git
Integrate Claude Code into your Git workflow. Smart commits, PR reviews, branch management, and conflict resolution.
Step-by-step
How to Use Claude Code with Git
Let Claude write commit messages
After making changes, ask Claude to commit: "commit these changes". Claude analyzes the diff, writes a descriptive commit message, and creates the commit.
Review changes before committing
Ask Claude: "review my uncommitted changes". Claude runs git diff, analyzes the changes, and provides feedback before you commit.
Create pull requests
Ask Claude to create a PR: "create a pull request". Claude analyzes all commits on the branch, writes a title and description, and creates the PR via the GitHub CLI.
Resolve merge conflicts
When you have merge conflicts, ask Claude: "resolve these merge conflicts". Claude reads both sides of the conflict, understands the intent, and produces a clean merge.
Tips
Pro tips
- *
Claude follows conventional commit format by default — customize via CLAUDE.md
- *
Use `/commit` as a shortcut for committing with Claude-generated messages
- *
Claude respects pre-commit hooks and will fix issues they catch
Related guides