Skip to main content
command CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/git.md
Open on GitHub

What 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.md

Call it with /git. For all projects use ~/.claude/commands/

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

Similar slash commands

All slash commands for Git and GitHub →

From the same set56

The whole set →
self-review self-review reviews a completed implementation by checking test evidence, edge cases, requirements, and residual risks before the final response. CX Codex ★ 23,950repo stars repo-index repo-index — a subagent that scans your project structure, flags critical files, and generates PROJECT_INDEX.md to compress context for efficient development. Run at the start of a session or after major code changes. CX Codex ★ 23,950repo stars backend-architect backend-architect is a Claude Code subagent for planning backend systems and APIs. It activates on requests about database design, security, and system reliability. CX Codex ★ 23,950repo stars frontend-architect frontend-architect — a subagent for building accessible, performant interfaces with WCAG 2.1 AA compliance. Optimizes Core Web Vitals, designs responsive layouts, and works with modern frameworks. CX Codex ★ 23,950repo stars devops-architect devops-architect automates infrastructure and CI/CD pipelines. Useful when planning zero-downtime releases and disaster recovery. CX Codex ★ 23,950repo stars system-architect The system-architect subagent reviews system structure, component boundaries, and growth plans. Use it when choosing patterns, technologies, or a migration path. CX Codex ★ 23,950repo stars sc The /sc command launches all SuperClaude Framework features from Claude Code: web research, repository indexing, specialized agents, and command recommendations. CX Codex +1 ★ 23,950repo stars performance-engineer performance-engineer profiles bottlenecks and speeds up web apps through before-and-after measurements. Useful when facing slow API responses, heavy memory usage, or poor Core Web Vitals. CX Codex ★ 23,950repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open