git — Claude Code command: smart commits and branch management
Command for managing Git repositories directly in Claude Code. Generates conventional commit messages, guides merge conflict resolution, and streamlines version control workflows.
MIT ★ 23,950 updated 2026-09-27
.claude/commands/git.mdWhat git does
The /sc:git command automates standard Git operations: checking status, staging and committing changes, managing branches, and merging. Its core strength is analyzing repository changes and generating commit descriptions following Conventional Commits format, eliminating manual message composition.
Under the hood, the command uses Bash for Git execution, Read for repository state analysis, and Grep for log parsing. It supports interactive mode to walk through merge conflict resolution step by step. The command validates context before running destructive operations and never modifies repository configuration without explicit permission.
Runs in Claude Code; installation means copying the git.md file into your project's .claude/commands/ directory.
What it helps with
- Write consistently formatted commit messages without extra thought
- See which files changed and what's ready to commit
- Resolve branch merges with guided conflict help
- Keep branch names and workflows aligned with team conventions
Example prompts for the agent
- /sc:git status
- /sc:git commit --smart-commit
- /sc:git merge feature-branch --interactive
How to install git
Manually: put the files in place
.claude/commands/git.mdCall it with /git. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/git.mdCall it with /prompts:git. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/git.prompt.mdManually: put the files in place
.gemini/commands/git.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about git
How do I install the git command in Claude Code?
Copy the git.md file into the .claude/commands/ directory at your project root. Create the folder if it doesn't exist. The /sc:git command will then be available in Claude Code.
What does --smart-commit do?
It analyzes your repository changes and generates a commit message in Conventional Commits format (for example, feat: add authentication or fix: resolve validation error). You skip writing the message yourself.
Can this command delete my files or break the repository?
No. It requires explicit confirmation before any destructive operation and never alters repository configuration without your consent.
Source text
git.md · MIT
--- name: git description: "Git operations with intelligent commit messages and workflow optimization" category: utility complexity: basic mcp-servers: [] personas: [] --- # /sc:git - Git Operations ## Triggers - Git repository operations: status, add, commit, push, pull, branch - Need for intelligent commit message generation - Repository workflow optimization requests - Branch management and merge operations ## Usage ``` /sc:git [operation] [args] [--smart-commit] [--interactive] ``` ## Behavioral Flow 1. **Analyze**: Check repository state and working directory changes 2. **Validate**: Ensure operation is appropriate for current Git context 3. **Execute**: Run Git command with intelligent automation 4. **Optimize**: Apply smart commit messages and workflow patterns 5. **Report**: Provide status and next steps guidance Key behaviors: - Generate conventional commit messages based on change analysis - Apply consistent branch naming conventions - Handle merge conflicts with guided resolution - Provide clear status summaries and workflow recommendations ## Tool Coordination - **Bash**: Git command execution and repository operations - **Read**: Repository state analysis and configuration review - **Grep**: Log parsing and status analysis - **Write**: Commit message generation and documentation ## Key Patterns - **Smart Commits**: Analyze changes → generate conventional commit message - **Status Analysis**: Repository state → actionable recommendations - **Branch Strategy**: Consistent naming and workflow enforcement - **Error Recovery**: Conflict resolution and state restoration guidance ## Examples ### Smart Status Analysis ``` /sc:git status # Analyzes repository state with change summary # Provides next steps and workflow recommendations ``` ### Intelligent Commit ``` /sc:git commit --smart-commit # Generates conventional commit message from change analysis # Applies best practices and consistent formatting ``` ### Interactive Operations ``` /sc:git merge feature-branch --interactive # Guided merge with conflict resolution assistance ``` ## Boundaries **Will:** - Execute Git operations with intelligent automation - Generate conventional commit messages from change analysis - Provide workflow optimization and best practice guidance **Will Not:** - Modify repository configuration without explicit authorization - Execute destructive operations without confirmation - Handle complex merges requiring manual intervention
© SuperClaude-Org · MIT · SuperClaude-Org/SuperClaude_Framework