git-advanced
Skill419 starsChanged 4 months agoMITView on GitHub
Advanced git operations including rebase, bisect, cherry-pick, and conflict resolution. Use when rebasing branches, debugging with bisect, cherry-picking commits, or resolving complex merge conflicts.
- Deletes or force-pushes
- Commits and pushes
3 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- adyba/pi-safe-workflowedited, first seen Jul 10, 2026
- rohitg00/awesome-claude-code-toolkittheir own version, first seen Feb 4, 2026
- AutumnsGrove/ClaudeSkillstheir own version, first seen Oct 26, 2025
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- adyba/pi-safe-workflow★ 079% same
Wrote their own version · 2
- rohitg00/awesome-claude-code-toolkit★ 2.7ksame name
- AutumnsGrove/ClaudeSkills★ 34same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/00-core-principles.mdcCursor rule
- .cursor/rules/01-git-workflow.mdcCursor rule
- .cursor/rules/02-pattern-discovery.mdcCursor rule
- .cursor/rules/03-safe-ai-dlc.mdcCursor rule
- .cursor/rules/04-knowledge-vault.mdcCursor rule
- .cursor/rules/10-backend-python.mdcCursor rule
- .cursor/rules/11-frontend-react.mdcCursor rule
- .cursor/rules/12-database-sql.mdcCursor rule
- .cursor/rules/13-testing.mdcCursor rule
- .cursor/rules/14-spec-creation.mdcCursor rule
- .cursor/rules/15-deployment.mdcCursor rule
- .cursor/rules/16-stripe-payments.mdcCursor rule
- .cursor/rules/20-agent-architect.mdcCursor rule
- .cursor/rules/21-agent-backend.mdcCursor rule
- .cursor/rules/22-agent-qas.mdcCursor rule
- .cursor/rules/23-agent-security.mdcCursor rule
- .cursor/rules/30-background-agents.mdcCursor rule
- .cursor/rules/31-mcp-integration.mdcCursor rule
- .cursor/rules/README.mdCursor rule
- agent-coordinationSkill
- api-patternsSkill
- confluence-docsSkill
- deployment-sopSkill
- frontend-patternsSkill
- git-advancedSkill
- linear-sopSkill
- migration-patternsSkill
- orchestration-patternsSkill
- pattern-discoverySkill
- release-patternsSkill
- rls-patternsSkill
- safe-ai-dlcSkill
- safe-workflowSkill
- security-auditSkill
- spec-creationSkill
- stripe-patternsSkill
- team-coordinationSkill
- testing-patternsSkill
- vault-syncSkill
- agent-coordinationSkill
- api-patternsSkill
- confluence-docsSkill
- deployment-sopSkill
- frontend-patternsSkill
- linear-sopSkill
- migration-patternsSkill
- orchestration-patternsSkill
- pattern-discoverySkill
- release-patternsSkill
- rls-patternsSkill
- safe-ai-dlcSkill
- safe-workflowSkill
- security-auditSkill
- spec-creationSkill
- stripe-patternsSkill
- team-coordinationSkill
- testing-patternsSkill
- vault-syncSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 94
Use bisect when you know a bug was introduced at some point but don't know which commit.
“Common” is measured: kept by at least 6 in 10 of the 3 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.
Files
Git Advanced Skill
Purpose
Provide guidance for advanced git operations with safety considerations. This project uses a rebase-first workflow with linear history—understand these patterns to avoid breaking the codebase.
When This Skill Applies
Invoke this skill when:
- Rebasing feature branches onto dev
- Using git bisect to find bugs
- Cherry-picking commits between branches
- Resolving complex merge conflicts
- Recovering from git mistakes
Stop-the-Line Conditions
FORBIDDEN Operations
# FORBIDDEN: Force push to protected branches
git push --force origin dev # ❌ NEVER
git push --force origin master # ❌ NEVER
# FORBIDDEN: Merge commits on dev branch
git merge feature-branch # ❌ Use rebase-and-merge PR strategy
# FORBIDDEN: Skip pre-commit hooks
git commit --no-verify # ❌ Hooks exist for a reason
# FORBIDDEN: Rewriting shared history
git rebase -i HEAD~5 && git push --force # ❌ If already pushedSAFE Operations
# SAFE: Force-with-lease on your feature branch
git push --force-with-lease origin {{TICKET_PREFIX}}-XXX-feature # ✅ Safe
# SAFE: Interactive rebase before first push
git rebase -i origin/dev # ✅ Squash/clean local commits
# SAFE: Force push after conflict resolution
git rebase origin/dev && git push --force-with-lease origin {{TICKET_PREFIX}}-XXX-featureRebase Workflow (Standard)
Before Creating PR
# 1. Fetch latest changes
git fetch origin dev
# 2. Rebase onto latest dev
git rebase origin/dev
# 3. If conflicts, resolve them
git status # See conflicted files
# ... edit files to resolve ...
git add <resolved-files>
git rebase --continue
# 4. Push with force-with-lease
git push --force-with-lease origin {{TICKET_PREFIX}}-XXX-featureDuring PR Review (After Feedback)
# 1. Make requested changes
git add . && git commit -m "fix: address PR feedback [{{TICKET_PREFIX}}-XXX]"
# 2. Fetch and rebase again
git fetch origin dev
git rebase origin/dev
# 3. Push update
git push --force-with-lease origin {{TICKET_PREFIX}}-XXX-featureGit Bisect (Finding Bugs)
When to Use
Use bisect when you know a bug was introduced at some point but don't know which commit.
Bisect Workflow
# 1. Start bisect
git bisect start
# 2. Mark current state (has bug)
git bisect bad
# 3. Mark a known good commit
git bisect good <commit-sha>
# e.g., git bisect good abc1234
# 4. Git checks out middle commit - test it
yarn test:unit # or manual test
# 5. Tell git if this commit is good or bad
git bisect good # or
git bisect bad
# 6. Repeat until found
# Git will tell you the first bad commit
# 7. End bisect
git bisect resetAutomated Bisect
# Run a test script automatically
git bisect start HEAD abc1234
git bisect run yarn test:specific-testCherry-Pick (Selective Commits)
When to Use
- Backporting a fix to an older branch
- Pulling a specific commit from one branch to another
- Selective feature extraction
Cherry-Pick Workflow
# 1. Find the commit SHA
git log --oneline branch-name | head -20
# 2. Cherry-pick to current branch
git cherry-pick <commit-sha>
# 3. If conflicts, resolve them
git status
# ... resolve conflicts ...
git add <resolved-files>
git cherry-pick --continue
# 4. Push the result
git push origin current-branchCherry-Pick Multiple Commits
# Range of commits (oldest..newest, exclusive of oldest)
git cherry-pick abc123^..def456
# Specific commits
git cherry-pick abc123 def456 ghi789Conflict Resolution
Common Conflict Scenarios
| Scenario | Resolution Strategy |
| Same line edited | Choose one version or combine |
| File deleted vs modified | Decide: keep modified or delete |
| Rename conflicts | Decide which name to use |
| Binary file conflicts | Choose one version explicitly |
Conflict Resolution Steps
# 1. See what's conflicted
git status
# 2. Open conflicted file, look for markers
<<<<<<< HEAD
your changes
=======
their changes
>>>>>>> branch-name
# 3. Edit file to resolve (remove markers, keep correct code)
# 4. Mark as resolved
git add <resolved-file>
# 5. Continue rebase/merge
git rebase --continue
# or
git merge --continueConflict Prevention
# Rebase frequently to avoid large conflicts
git fetch origin dev
git rebase origin/dev # Do this daily during long features
# Check for potential conflicts before rebase
git diff origin/dev...HEAD --statRecovery Commands
Abort Operations
# Abort rebase
git rebase --abort
# Abort merge
git merge --abort
# Abort cherry-pick
git cherry-pick --abortUndo Last Commit
# Keep changes staged
git reset --soft HEAD~1
# Keep changes unstaged
git reset HEAD~1
# Discard changes (DANGEROUS)
git reset --hard HEAD~1Recover Lost Commits
# Find lost commits in reflog
git reflog
# Restore to a specific state
git reset --hard HEAD@{n}
# Cherry-pick a lost commit
git cherry-pick <sha-from-reflog>Safety Guidelines
When to Ask Before Force Push
ALWAYS ask first if:
- You've pushed commits that others might have pulled
- You're working on a shared branch
- You're not 100% sure what will happen
- The branch has been open for > 1 week
Safe Force Push Pattern
# 1. Verify you're on correct branch
git branch
# 2. Verify what will be pushed
git log origin/{{TICKET_PREFIX}}-XXX-feature..HEAD --oneline
# 3. Use force-with-lease (protects against overwriting others' work)
git push --force-with-lease origin {{TICKET_PREFIX}}-XXX-featurePre-Push Checklist
- Running
yarn ci:validatepasses - On correct branch (not dev or master)
- Commits have proper message format
- No sensitive data in commits
Related Resources
- CONTRIBUTING.md: Branch naming and commit format
- safe-workflow skill: Complete workflow patterns
- release-patterns skill: PR and merge patterns
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
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.

