agentleFS
nguyenthanhtatnguyenthanhtat/screen1-claude/skills/git/SKILL.md

git

Skill2 starsChanged 21 days agoMITView on GitHub

Git expertise for everyday and advanced work: commits, branching, merging and rebasing, history/blame/bisect, remotes and forks, conflict resolution, undoing mistakes and recovering lost work, team workflows (GitHub Flow, Git Flow), stash, cherry-pick, hooks. Use when the user asks how to do something with git, is stuck in a git state, has a merge/rebase conflict, or wants to undo or recover changes.

57 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use sql, databases and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • thechandanbhagatSkill

    sql

    Write SQL queries, optimize database performance, design schemas, and debug SQL issues. Use for database operations, query optimization, and schema design.

    Also in 4 projects that use this

  • mrgoonieSkill

    databases

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin). Use when designing database schemas, writing queries and aggregations, optimizing indexes for performance, performing database migrations, configuring replication and sharding, implementing backup and restore strategies, managing database users and permissions, analyzing query performance, or administering production databases.

    Also in 3 projects that use this

  • mrgoonieSkill

    devops

    Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.

    Also in 4 projects that use this

  • MicrosoftSkill

    typescript

    TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.

    Also in 4 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    test

    Also in 8 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

26 rules. 0 are common, 16 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 51 edited versions we read keep these.

  • 16

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Compatibility: All major Git hosting platforms (GitHub, GitLab, Bitbucket)

    line 17
  2. Distinctive:

    Use skill paths to access specific functionality:

    line 22
  3. Very specific:

    If you just use /git, Claude will analyze your request and automatically route to the appropriate sub-skill.

    line 61
  4. Distinctive:

    Create and switch branches

    line 144
  5. Distinctive:

    Delete local and remote branches

    line 147
  6. Distinctive:

    Focus: Commit history and code archaeology

    line 156
  7. Distinctive:

    Add and remove remotes

    line 172
  8. Distinctive:

    Create and use Git hooks

    line 231
  9. Distinctive:

    Use worktrees for parallel work

    line 232
  10. Very specific:

    Start with /git/basics to learn fundamental concepts:

    line 326
  11. Very specific:

    Use /git/branching for branch workflows:

    line 333
  12. Very specific:

    Use /git/undo to fix problems:

    line 340
  13. Very specific:

    Use /git/conflicts to resolve:

    line 347
  14. Very specific:

    Use /git/workflows for patterns:

    line 354
  15. Very specific:

    Use conventional commits: feat:, fix:, docs:, etc.

    line 381
  16. Distinctive:

    Commit frequently with meaningful messages

    line 394
  17. Distinctive:

    Use .gitignore to exclude generated files

    line 395
  18. Distinctive:

    Never commit secrets or credentials

    line 396
  19. Distinctive:

    Keep commits focused (one logical change per commit)

    line 397
  20. Distinctive:

    Always review changes before pushing

    line 400
  21. Distinctive:

    Use git fetch first to see what's new

    line 401
  22. Distinctive:

    Avoid force push to shared branches

    line 402
  23. Very specific:

    Use --force-with-lease if force push is necessary

    line 403
  24. Distinctive:

    Use the appropriate sub-skill for your specific need

    line 425
  25. Very specific:

    Check Git documentation with git help <command>

    line 426
  26. Very specific:

    Use /git/troubleshooting patterns in relevant sub-skills

    line 428

“Common” is measured: kept by at least 6 in 10 of the 51 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sub-skills are files in this skill's folder. The /git/<name> paths below are routing labels, not commands: after choosing a sub-skill from the decision tree, read <name>/SKILL.md next to this file (e.g. basics/SKILL.md, conflicts/SKILL.md) and follow it.

Git Skill Suite

Purpose

Comprehensive Git expertise covering all workflows, from basic commits to advanced operations, conflict resolution, and team collaboration patterns.

Version

  • Version: 1.0.0
  • Last Updated: 2025-02-11
  • Git Version: 2.30+
  • Compatibility: All major Git hosting platforms (GitHub, GitLab, Bitbucket)

How to Use This Skill

Direct Sub-Skill Access

Use skill paths to access specific functionality:

  • /git/basics - Repository setup, commits, and fundamental workflows
  • /git/branching - Branch management, merging, and rebasing
  • /git/history - Commit history, diffs, and code archaeology
  • /git/remote - Remote repository operations and syncing
  • /git/conflicts - Merge and rebase conflict resolution
  • /git/undo - Undo changes and recover lost work
  • /git/workflows - Team workflows (GitHub Flow, Git Flow, etc.)
  • /git/advanced - Stash, cherry-pick, hooks, and power features

Chat Command Examples

# Basic operations
/git/basics help me commit my changes with a good message

# Branching
/git/branching create feature branch and merge to main

# Conflict resolution
/git/conflicts resolve merge conflict in src/app.js

# History inspection
/git/history find when this bug was introduced

# Undo mistakes
/git/undo I accidentally committed to main, help me undo

# Remote operations
/git/remote sync my fork with upstream

# Team workflows
/git/workflows setup GitHub Flow for our team

# Advanced features
/git/advanced use stash to switch contexts quickly

Auto-Routing (Claude Decides)

If you just use /git, Claude will analyze your request and automatically route to the appropriate sub-skill.

Examples:

  • "How do I commit my changes?" → routes to /basics
  • "Create a new branch" → routes to /branching
  • "I have a merge conflict" → routes to /conflicts
  • "View commit history" → routes to /history
  • "Undo last commit" → routes to /undo
  • "Push to GitHub" → routes to /remote
  • "What's GitHub Flow?" → routes to /workflows
  • "Save work without committing" → routes to /advanced

Decision Tree

User Request Analysis:
│
├─ Keywords: init, clone, commit, add, status, push, pull, .gitignore
│  → /basics
│
├─ Keywords: branch, checkout, merge, rebase, delete branch, switch
│  → /branching
│
├─ Keywords: log, diff, show, blame, bisect, history, who changed
│  → /history
│
├─ Keywords: remote, fetch, upstream, origin, fork, sync
│  → /remote
│
├─ Keywords: conflict, merge conflict, rebase conflict, <<<<<<, resolve
│  → /conflicts
│
├─ Keywords: undo, reset, revert, restore, reflog, recover, amend
│  → /undo
│
├─ Keywords: workflow, github flow, git flow, trunk-based, PR, pull request
│  → /workflows
│
└─ Keywords: stash, cherry-pick, hook, submodule, worktree, filter-branch
   → /advanced

Requirements (Global)

<critical> All sub-skills require: - Git 2.30+ installed (`git --version`) - Git configured with user.name and user.email - Repository access (local or remote) - For remote operations: SSH keys or HTTPS credentials configured </critical>

Quick Setup Verification

# Check Git version
git --version

# Check configuration
git config --list

# Verify you can authenticate
git ls-remote https://github.com/user/repo

Sub-Skills Overview

1. Basics

Focus: Repository fundamentals and daily workflows Common tasks:

  • Initialize new repository
  • Clone existing repository
  • Stage and commit changes
  • Push and pull from remote
  • Create .gitignore files
  • Configure Git settings

Key commands: init, clone, add, commit, push, pull, status


2. Branching

Focus: Branch management and integration Common tasks:

  • Create and switch branches
  • Merge branches (fast-forward and three-way)
  • Rebase for linear history
  • Delete local and remote branches
  • Track remote branches
  • Interactive rebase for cleanup

Key commands: branch, checkout, switch, merge, rebase


3. History

Focus: Commit history and code archaeology Common tasks:

  • View commit history with filters
  • Compare changes between commits
  • Find who changed a line (blame)
  • Binary search for bug introduction (bisect)
  • Search commit messages
  • Visualize branch history

Key commands: log, diff, show, blame, bisect


4. Remote

Focus: Remote repository operations Common tasks:

  • Add and remove remotes
  • Fetch vs pull (when to use each)
  • Push with upstream tracking
  • Manage multiple remotes (origin, upstream)
  • Force push safely
  • Sync fork with upstream

Key commands: remote, fetch, pull, push


5. Conflicts

Focus: Conflict resolution strategies Common tasks:

  • Understand conflict markers
  • Resolve merge conflicts
  • Resolve rebase conflicts
  • Use merge tools
  • Accept theirs/ours strategy
  • Prevent conflicts (pull before push)

Key commands: merge, rebase, mergetool, checkout --ours/--theirs


6. Undo

Focus: Reversing changes and recovery Common tasks:

  • Undo staged changes
  • Undo working directory changes
  • Amend last commit
  • Reset commits (soft, mixed, hard)
  • Revert commits (safe for public history)
  • Recover deleted commits with reflog

Key commands: restore, reset, revert, reflog, amend


7. Workflows

Focus: Team collaboration patterns Common tasks:

  • GitHub Flow (feature branches + PRs)
  • Git Flow (release branches)
  • Trunk-Based Development
  • Forking workflow (open source)
  • Pull request best practices
  • Code review workflows

Patterns: Feature branches, release management, hotfixes


8. Advanced

Focus: Power user features Common tasks:

  • Stash uncommitted changes
  • Cherry-pick specific commits
  • Manage submodules
  • Create and use Git hooks
  • Use worktrees for parallel work
  • Sparse checkout for large repos

Key commands: stash, cherry-pick, submodule, worktree, hook


Workflow Integration

For Team Development

# Step 1: Clone repository and setup
/git/basics clone team repository and configure settings

# Step 2: Create feature branch
/git/branching create feature branch from main

# Step 3: Make changes and commit
/git/basics commit changes with conventional commit message

# Step 4: Sync with remote
/git/remote pull latest changes from main

# Step 5: Resolve any conflicts
/git/conflicts resolve merge conflicts if any

# Step 6: Push feature branch
/git/remote push feature branch to origin

# Step 7: Review history before PR
/git/history review my commits before creating pull request

# Step 8: Follow team workflow
/git/workflows create pull request following GitHub Flow

For Solo Projects

# Initialize project
/git/basics setup new repository with .gitignore

# Regular workflow
/git/basics commit and push changes

# Undo mistakes
/git/undo fix commit message or undo changes

# Experiment safely
/git/branching create experimental branch

# Save work in progress
/git/advanced stash changes to switch context

For Open Source Contribution

# Step 1: Fork and clone
/git/remote setup fork with upstream remote

# Step 2: Create feature branch
/git/branching create feature branch from upstream/main

# Step 3: Make changes
/git/basics commit changes following project guidelines

# Step 4: Sync with upstream
/git/remote sync fork with upstream

# Step 5: Clean up commits
/git/branching interactive rebase to squash commits

# Step 6: Submit PR
/git/workflows follow project contribution workflow

Quick Reference

TaskSub-SkillCommand Example
First commitbasics/git/basics initialize repository and make first commit
Create branchbranching/git/branching create feature branch for login page
Merge conflictconflicts/git/conflicts resolve conflict in package.json
View historyhistory/git/history show commits from last week
Undo commitundo/git/undo undo last commit but keep changes
Push to GitHubremote/git/remote push branch to GitHub
GitHub Flowworkflows/git/workflows explain GitHub Flow process
Save WIPadvanced/git/advanced stash changes and switch branch

Common Scenarios

"I'm new to Git"

Start with /git/basics to learn fundamental concepts:

  • What is a repository?
  • How to make commits
  • Basic workflow (add → commit → push)
  • Setting up .gitignore

"I need to work on a feature"

Use /git/branching for branch workflows:

  • Create feature branch
  • Make commits on branch
  • Merge back to main
  • Delete feature branch

"I made a mistake"

Use /git/undo to fix problems:

  • Uncommit changes
  • Unstage files
  • Discard local changes
  • Recover deleted commits

"I have conflicts"

Use /git/conflicts to resolve:

  • Understand conflict markers
  • Choose correct version
  • Test after resolution
  • Complete merge/rebase

"We need a team workflow"

Use /git/workflows for patterns:

  • Choose workflow (GitHub Flow, Git Flow, etc.)
  • Set up branch protection
  • Define PR process
  • Establish code review standards

Installation

Copy this entire folder to your Claude skills directory:

# Option 1: User skills (recommended)
cp -r skills/git ~/.claude/skills/git

# Option 2: Windows PowerShell
Copy-Item -Recurse skills/git $env:USERPROFILE\.claude\skills\git

Then configure in your .claude file:

skills:
  - ~/.claude/skills/git

Best Practices

Commit Messages

  • Use conventional commits: feat:, fix:, docs:, etc.
  • First line: brief summary (50 chars or less)
  • Blank line, then detailed explanation if needed
  • Reference issue numbers: Fixes #123

Branch Naming

  • feature/description - New features
  • fix/description - Bug fixes
  • hotfix/description - Urgent production fixes
  • docs/description - Documentation changes

Git Hygiene

  • Pull before push to avoid conflicts
  • Commit frequently with meaningful messages
  • Use .gitignore to exclude generated files
  • Never commit secrets or credentials
  • Keep commits focused (one logical change per commit)

Remote Operations

  • Always review changes before pushing
  • Use git fetch first to see what's new
  • Avoid force push to shared branches
  • Use --force-with-lease if force push is necessary

Related Documentation

Changelog

1.0.0 (2025-02-11)

  • Initial Git skill suite release
  • 8 sub-skills covering all major Git operations
  • Support for GitHub Flow, Git Flow, and trunk-based development
  • Comprehensive conflict resolution patterns
  • Advanced features (stash, cherry-pick, hooks, worktrees)

Support

For Git issues or questions:

  1. Use the appropriate sub-skill for your specific need
  2. Check Git documentation with git help <command>
  3. Review error messages carefully - Git provides helpful hints
  4. Use /git/troubleshooting patterns in relevant sub-skills

License

Free to use and modify for personal/commercial projects.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.