Git Master

VerifiedCaution

Handles advanced git operations including branch management, merge conflict resolution, and history rewriting. Provides safe workflows with explicit confirmation for destructive commands like force push and rebase. Helps developers maintain clean commit history and recover from common git issues.

Sby Skills Guide Bot
DevelopmentAdvanced
6/2/2026
Claude CodeCursorWindsurfCopilotCodex
#git#version-control#workflow#branch-management#conflict-resolution

Recommended for

Automated summary

This skill handles advanced git operations such as branch management, merge conflict resolution, history manipulation, and recovery patterns.

Strengths

  • Automates complex git workflows with precise commands and safety checks.
  • Includes a dangerous operations checklist to prevent accidental data loss.
  • Covers a wide range of tasks: rebase, stash, bisect, worktree, and recovery.

Limitations

  • Requires explicit user confirmation before destructive commands, which may interrupt flow.
  • Some operations (e.g., bisect) are interactive and require user input.
  • Lacks native support for platform-specific git hosting features (e.g., PR comments) beyond basic `gh` usage.
When to use it

Use for any advanced git operation where you need automated guidance and safety guardrails.

When not to use it

Avoid for simple daily git tasks (add/commit/push) as the extra safeguarding may be overkill.

Security analysis

Caution
Quality score92/100

The skill contains commands that can rewrite history or discard local changes, which could cause data loss if used carelessly. However, it explicitly states to never run destructive commands without user confirmation and includes safety checklists. It does not instruct any malicious actions like exfiltrating secrets or running arbitrary scripts.

Findings
  • •Skill instructs potentially destructive git operations (force push, hard reset, rebase) even though it includes safety warnings and user confirmation requirements.
  • •No network exfiltration or code execution beyond standard git operations.
How this analysis is made

Examples

Squash last three commits
Squash the last three commits into one with a combined commit message.
Recover deleted branch
I accidentally deleted a branch called 'feature/new-login'. Can you help me recover it using reflog?
Resolve merge conflict
I have a merge conflict in 'src/app.ts' after rebasing. Walk me through resolving it and continuing the rebase.

Git Master Skill

Advanced git operations and workflow management.

Trigger

  • Complex git operations
  • Branch management
  • Merge conflict resolution
  • Git history manipulation

Instructions

When this skill is invoked, you handle advanced git workflows.

Safety First

NEVER run without explicit user confirmation:

  • git push --force
  • git reset --hard
  • git rebase on shared branches
  • Any history-rewriting operation

ALWAYS:

  • Check current branch before operations
  • Verify remote status
  • Create backup branches for risky operations

Common Operations

Clean Commit History

# Interactive rebase for cleaning commits
git rebase -i HEAD~n

# Squash commits
git reset --soft HEAD~n
git commit -m "Combined commit message"

Branch Management

# Create and switch to new branch
git checkout -b feature/name

# Update branch with latest main
git fetch origin
git rebase origin/main

# Clean up merged branches
git branch --merged | grep -v "main\|master" | xargs git branch -d

Conflict Resolution

  1. Identify conflicts: git status
  2. Open conflicted files
  3. Choose correct resolution
  4. Stage resolved files: git add <file>
  5. Continue: git rebase --continue or git merge --continue

Undo Operations

# Undo last commit (keep changes)
git reset --soft HEAD~1

# Undo last commit (discard changes)
git reset --hard HEAD~1

# Undo a specific commit (creates new commit)
git revert <commit-hash>

# Recover deleted branch
git reflog
git checkout -b recovered-branch <commit-hash>

Commit Message Guidelines

<type>(<scope>): <subject>

<body>

<footer>

Types:

  • feat: New feature
  • fix: Bug fix
  • refactor: Code restructuring
  • docs: Documentation
  • test: Tests
  • chore: Maintenance

Example:

feat(auth): add JWT token refresh

Implement automatic token refresh when access token
expires. Refresh happens 5 minutes before expiration.

Closes #123

PR Workflow

# Update feature branch
git fetch origin
git rebase origin/main

# Push (with lease for safety)
git push --force-with-lease

# Create PR
gh pr create --title "feat: description" --body "..."

Stash Operations

# Stash with message
git stash push -m "WIP: feature description"

# List stashes
git stash list

# Apply specific stash
git stash apply stash@{n}

# Pop and delete
git stash pop

Bisect for Bug Finding

# Start bisect
git bisect start

# Mark current as bad
git bisect bad

# Mark known good commit
git bisect good <commit>

# Test each commit, mark good/bad
git bisect good  # or git bisect bad

# End bisect
git bisect reset

Worktree for Parallel Work

# Create worktree for different branch
git worktree add ../project-hotfix hotfix-branch

# List worktrees
git worktree list

# Remove worktree
git worktree remove ../project-hotfix

Recovery Patterns

Lost Commits

# Find in reflog
git reflog

# Cherry-pick or checkout
git cherry-pick <commit>

Corrupted Repository

# Verify integrity
git fsck --full

# Recover from remote
git fetch origin
git reset --hard origin/main

Best Practices

  1. Commit Often: Small, focused commits
  2. Write Good Messages: Future you will thank you
  3. Branch Per Feature: Keep main clean
  4. Rebase Before PR: Clean history
  5. Never Force Push Main: Protect shared branches
  6. Use Tags for Releases: git tag -a v1.0.0 -m "Release 1.0.0"

Dangerous Operations Checklist

Before running destructive commands:

  • [ ] On correct branch?
  • [ ] Have backup/can recover?
  • [ ] Others affected?
  • [ ] User explicitly confirmed?

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/git-master-mm78nnyf/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/git-master-mm78nnyf' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/git-master-mm78nnyf/download' --output '.skill-downloads/git-master-mm78nnyf/SKILL.md.part' && mv '.skill-downloads/git-master-mm78nnyf/SKILL.md.part' '.skill-downloads/git-master-mm78nnyf/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/git-master-mm78nnyf/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills