Claude Code Plugins

Community-maintained marketplace

Feedback
15
0

Automate git commands. Use for commits, branches, merges, or repository management tasks.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name git-operations
description Automate git commands. Use for commits, branches, merges, or repository management tasks.

Git Operations

Automate git workflows using subprocess or GitPython.

Quick Start

import subprocess

def run_git(args: list[str]) -> str:
    result = subprocess.run(
        ["git"] + args,
        capture_output=True,
        text=True,
        check=True
    )
    return result.stdout.strip()

# Get current branch
branch = run_git(["branch", "--show-current"])

# Check status
status = run_git(["status", "--porcelain"])

Common Patterns

Stage and commit

run_git(["add", "."])
run_git(["commit", "-m", "Your commit message"])

Branch operations

# Create and switch to branch
run_git(["checkout", "-b", "feature/new-feature"])

# List branches
branches = run_git(["branch", "-a"]).splitlines()

# Delete branch
run_git(["branch", "-d", "old-branch"])

Check for changes

def has_changes() -> bool:
    status = run_git(["status", "--porcelain"])
    return bool(status)

Get commit info

# Latest commit hash
commit_hash = run_git(["rev-parse", "HEAD"])

# Commit message
message = run_git(["log", "-1", "--format=%s"])

# Files changed in last commit
files = run_git(["diff", "--name-only", "HEAD~1"]).splitlines()

Safe operations

def safe_checkout(branch: str) -> bool:
    try:
        run_git(["checkout", branch])
        return True
    except subprocess.CalledProcessError:
        return False