[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M753TFKX4JC1V872Z8EXNC4S":3,"skill-same:01M753TFKX4JC1V872Z8EXNC4S":86},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":14,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M753TFKX4JC1V872Z8EXNC4S","git-rebase",null,"Intelligently handle git rebase operations and resolve merge conflicts while preserving features and maintaining code quality. Use when rebasing feature branches, resolving conflicts across commits, and ensuring clean linear history without losing changes. Don't use for merge-commit workflows, cherry-picking individual commits, or initial repository setup.","haryelramalho\u002Fskills","haryelramalho","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F38708454?v=4","01M753ESC6XNS6GXGV5X9YMKGA","Haryel Ramalho","01M753ESCSPRNDTEJRVRYY1VJ0",0,"MIT","https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: git-rebase\ndescription: Intelligently handle git rebase operations and resolve merge conflicts while preserving features and maintaining code quality. Use when rebasing feature branches, resolving conflicts across commits, and ensuring clean linear history without losing changes. Don't use for merge-commit workflows, cherry-picking individual commits, or initial repository setup.\nmetadata:\n  author: Pedro Nauck\n  github: https:\u002F\u002Fgithub.com\u002Fpedronauck\n  repository: https:\u002F\u002Fgithub.com\u002Fpedronauck\u002Fskills\n---\n# Git Rebase with Intelligent Conflict Resolution\n\n## Quick Start\n\nFor most rebases with multiple commits, use the squash-first strategy to resolve conflicts only once:\n\n```bash\n# Step 1: Backup current state\nbash scripts\u002Fpre-rebase-backup.sh\n\n# Step 2: Squash commits (interactive rebase on current branch)\ngit rebase -i $(git merge-base HEAD origin\u002Fmain)\n\n# Step 3: Rebase onto target\ngit rebase origin\u002Fmain\n\n# Step 4: If conflicts, resolve them once (see workflow below)\n# Then continue: git rebase --continue\n\n# Step 5: Force push safely\ngit push origin $(git rev-parse --abbrev-ref HEAD) --force-with-lease\n```\n\nThis approach resolves conflicts once instead of per-commit, saving time and mental overhead.\n\n## Core Workflow: Conflict Analysis & Resolution\n\nCopy this checklist and mark progress:\n\n```\nRebase Workflow:\n- [ ] Step 1: Create safety backup\n- [ ] Step 2: Fetch latest from target branch\n- [ ] Step 3: Analyze conflict scope\n- [ ] Step 4: Choose resolution strategy\n- [ ] Step 5: Apply conflict resolutions\n- [ ] Step 6: Validate merged code\n- [ ] Step 7: Run tests\n- [ ] Step 8: Force push safely\n```\n\n### Step 1: Create Safety Backup\n\nALWAYS do this first. If rebase goes wrong, you can recover:\n\n```bash\n# Use the bundled script\nbash scripts\u002Fpre-rebase-backup.sh\n\n# Or manually create timestamped backup branch\nTIMESTAMP=$(date +%Y%m%d_%H%M%S)\ngit branch backup-rebase-$TIMESTAMP\n\n# Alternative: Create temporary ref to your current commit\ngit reflog  # Note your current HEAD SHA for manual recovery\n```\n\nThis costs nothing and saves hours of work if something goes wrong.\n\n### Step 2: Fetch Latest Changes\n\nEnsure you have the most recent remote state:\n\n```bash\n# Fetch without modifying local branches\ngit fetch origin\n\n# View the divergence\ngit log --oneline origin\u002Fmain..HEAD  # Your commits\ngit log --oneline HEAD..origin\u002Fmain  # New commits on main\n```\n\nUnderstand how many commits you're rebasing and how much main has changed.\n\n### Step 3: Analyze Conflict Scope\n\nBefore starting the rebase, predict conflicts:\n\n```bash\n# See which files you changed\ngit diff --name-only origin\u002Fmain...HEAD\n\n# See which files main changed\ngit diff --name-only origin\u002Fmain HEAD\n\n# Likely conflict areas: files changed in both\n```\n\n**Key insight**: If you changed `auth.ts` and so did main, you WILL get conflicts in `auth.ts`.\n\nAnticipating conflicts helps you understand how to resolve them.\n\n### Step 4: Choose Resolution Strategy\n\n**For detailed strategy comparison and decision matrix**, see [references\u002Fstrategies.md](references\u002Fstrategies.md).\n\n#### Strategy A: Squash First (Recommended for 3+ commits)\n\n**When to use**: Multiple feature commits with many conflicts expected\n\n**Why**: Reduces conflicts to one resolution phase instead of per-commit\n\n```bash\n# Interactive rebase on current branch first\ngit rebase -i $(git merge-base HEAD origin\u002Fmain)\n\n# In editor, change all \"pick\" to \"squash\" (or 's') except first commit\n# Save and exit - commits are squashed into one\n# Edit commit message to describe the entire feature\n\n# Now rebase the squashed commit\ngit rebase origin\u002Fmain\n\n# Resolve conflicts once, then git rebase --continue\n```\n\n**Tradeoffs**: Lose individual commit history, but simpler conflict resolution\n\n#### Strategy B: Interactive Rebase with Conflict Awareness\n\n**When to use**: 1-2 commits, clean history, or complex per-commit logic\n\n```bash\ngit rebase -i origin\u002Fmain\n\n# In editor, you can:\n# - Reorder commits to isolate conflict-prone ones\n# - Drop commits that are already in main (git detects this)\n# - Combine related commits before rebasing\n\n# Save and exit - rebase proceeds, stopping at conflicts\n```\n\n**Tradeoffs**: More control, but more conflict-resolution iterations\n\n#### Strategy C: Simple Linear Rebase (Fastest, Auto-Resolution)\n\n**When to use**: Simple cases, no critical decisions, or in automated pipelines\n\n```bash\n# Rebase all commits at once\ngit rebase origin\u002Fmain\n\n# If no conflicts, done\n# If conflicts, you resolve each one\n```\n\n**Warning**: Not recommended for complex scenarios. Use Strategies A or B instead.\n\n### Step 5: Apply Conflict Resolutions\n\nWhen `git rebase` pauses with conflicts, use the analysis script:\n\n```bash\n# Analyze conflicts\nbash scripts\u002Fanalyze-conflicts.sh\n\n# See which files conflict\ngit status\n\n# For each conflicted file:\n# - RECOMMENDED: Use merge tool for visual clarity\ngit mergetool --no-prompt\n\n# - ALTERNATIVE: Manual edit in your editor\n# Search for conflict markers: \u003C\u003C\u003C\u003C\u003C\u003C, ======, >>>>>>\n```\n\n#### Conflict Marker Anatomy\n\n```javascript\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\n\u002F\u002F Your current feature code\nfunction authenticate(token) {\n  validateToken(token);\n  return true;\n}\n=======\n\u002F\u002F Main branch code (incoming)\nfunction authenticate(token) {\n  if (!token) throw new Error(\"No token\");\n  validateToken(token);\n  setSession(token);\n  return true;\n}\n>>>>>>> origin\u002Fmain\n```\n\n**Decision framework** (before deleting markers):\n\n1. **Can you keep both?** YES → Merge them intelligently\n\n   ```javascript\n   function authenticate(token) {\n     if (!token) throw new Error(\"No token\"); \u002F\u002F Keep main's validation\n     validateToken(token);\n     setSession(token); \u002F\u002F Keep main's session setup\n     return true; \u002F\u002F Keep feature's return\n   }\n   ```\n\n2. **Conflicting logic?** Understand WHY they differ, then decide\n   - Did main add critical security checks? → Keep main's version\n   - Did your feature add essential functionality? → Keep feature's version\n   - Are they trying to do different things? → Combine intentionally\n\n3. **Lost features?** NEVER let a feature silently disappear\n   - If you added authentication logic, ensure it's in final version\n   - If main improved database access, ensure that's preserved\n\n**For detailed resolution patterns**, see [references\u002Fresolution-patterns.md](references\u002Fresolution-patterns.md).\n\n#### Key Resolution Principles\n\n**✅ DO**:\n\n- Keep both versions' important functionality when possible\n- Use the merge tool for visual representation\n- Add comments explaining merged conflicts: `\u002F\u002F Merged from both versions: main's validation + feature's session setup`\n- Test each file after resolution\n\n**❌ DON'T**:\n\n- Mindlessly pick one version without understanding both\n- Delete conflict markers without understanding the conflict\n- Keep duplicate code - merge intelligently\n- Skip testing before continuing\n\n### Step 6: Validate Merged Code\n\nAfter resolving conflicts, validate the merged code:\n\n```bash\n# Use the validation script\nbash scripts\u002Fvalidate-merge.sh\n\n# Manual checks:\n# 1. Check syntax\nnpm run lint  # or eslint, pylint, etc.\n\n# 2. Check types (if TypeScript)\nnpm run type-check  # or tsc --noEmit\n\n# 3. Spot-check key files\ngit diff HEAD origin\u002Fmain -- \u003Cconflicted-file>\n\n# If validation fails:\n# 1. Fix the issue in the file\n# 2. git add \u003Cfile>\n# 3. git rebase --continue\n```\n\n**Important**: Validation catches mistakes BEFORE you commit them.\n\n### Step 7: Run Tests\n\nThis is your safety net:\n\n```bash\n# Run full test suite\nnpm test\n\n# Or specific tests for changed areas\nnpm test -- --testPathPattern=auth  # If auth.ts was changed\n\n# If tests fail:\n# 1. Understand what broke\n# 2. Fix in the files\n# 3. git add \u003Cfiles>\n# 4. git rebase --continue\n```\n\n**Rule**: Never force-push code that fails tests.\n\n### Step 8: Force Push Safely\n\nUse `--force-with-lease` instead of `--force`. It protects against accidentally overwriting others' work:\n\n```bash\n# SAFE: Protects others' commits\ngit push origin $(git rev-parse --abbrev-ref HEAD) --force-with-lease\n\n# UNSAFE: Can overwrite others' work\ngit push origin your-branch -f  # Don't do this\n\n# If force-with-lease fails:\n# Someone else pushed to your branch\n# Coordinate with them before forcing\n```\n\n## Common Scenarios & Strategies\n\n### Scenario 1: Many Small Conflicts Across 5+ Commits\n\n**Use**: Squash-first strategy\n\n```bash\ngit rebase -i $(git merge-base HEAD origin\u002Fmain)\n# Mark all but first commit as 's' (squash)\n# Save - commits squash into one\n\ngit rebase origin\u002Fmain\n# Resolve conflicts once\ngit rebase --continue\n\n# Only one conflict-resolution phase!\n```\n\n**Why**: Each commit might have conflicts. Squashing before rebasing means one pass.\n\n### Scenario 2: One Specific Commit Has Conflicts\n\n**Use**: Target that commit with interactive rebase\n\n```bash\ngit rebase -i origin\u002Fmain\n\n# In editor, move the problematic commit to the end\n# Save - rebase proceeds, stopping at that commit\n\n# When it stops, you know exactly which commit conflicts\ngit status  # See what changed in this commit\n\n# Resolve, then continue\ngit rebase --continue\n```\n\n**Why**: Isolating the commit helps you understand what it's trying to do.\n\n### Scenario 3: Conflicts Keep Repeating (Same File, Different Commits)\n\n**Use**: Git rerere (reuse recorded resolution)\n\n```bash\n# Enable rerere globally (one-time setup)\ngit config --global rerere.enabled true\n\n# Now when you hit the same conflict in a second commit,\n# Git automatically applies the first commit's resolution\n\ngit rebase origin\u002Fmain\n\n# Git remembers your first conflict resolution\n# and replays it automatically for similar conflicts\n```\n\n**Why**: When rebasing and hitting the same file repeatedly, rerere saves manual work.\n\n### Scenario 4: Rebase Conflicts Are Too Complex\n\n**Emergency escape plan**:\n\n```bash\n# Abort the rebase - return to original state\ngit rebase --abort\n\n# Fall back to merge (safer for complex scenarios)\ngit merge origin\u002Fmain\n\n# Or try a different approach:\n# - Squash your entire feature branch first\n# - Cherry-pick main's critical changes selectively\n```\n\n**Important**: It's okay to abort and rethink. Better than a broken rebase.\n\n## Bundled Scripts\n\nThis skill includes helper scripts in `scripts\u002F`:\n\n- **`pre-rebase-backup.sh`**: Creates a safety backup before rebasing\n- **`analyze-conflicts.sh`**: Analyzes current conflicts and provides detailed information\n- **`validate-merge.sh`**: Validates that merge\u002Frebase is clean and ready for testing\n\nRun scripts with `bash scripts\u002F\u003Cscript-name>.sh`.\n\n## Reference Files\n\nFor detailed information on specific topics:\n\n- **Strategies**: [references\u002Fstrategies.md](references\u002Fstrategies.md) - Complete strategy comparison and decision matrix\n- **Resolution Patterns**: [references\u002Fresolution-patterns.md](references\u002Fresolution-patterns.md) - Common conflict resolution patterns and heuristics\n- **Troubleshooting**: [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md) - Solutions to common rebase problems\n- **Automation**: [references\u002Fautomation.md](references\u002Fautomation.md) - Automated conflict resolution for CI\u002FCD\n- **Scripts & Tools**: [references\u002Fscripts-tools.md](references\u002Fscripts-tools.md) - Additional git commands and tool usage\n\n## Checklist: Before You Commit to Rebasing\n\n- [ ] Understand why you're rebasing (cleaner history, syncing with main, etc.)\n- [ ] Backup your current branch: `bash scripts\u002Fpre-rebase-backup.sh`\n- [ ] Run tests on current branch - they should pass\n- [ ] Fetch latest: `git fetch origin`\n- [ ] Understand what you'll be rebasing (5 commits? 50?)\n- [ ] Understand main's recent changes (1 commit? Major refactor?)\n- [ ] Choose your strategy (see [references\u002Fstrategies.md](references\u002Fstrategies.md))\n- [ ] Have your merge tool ready (if using GUI)\n- [ ] Block 30 mins - don't rush conflict resolution\n- [ ] Have tests ready to run after rebase\n\n## When NOT to Rebase\n\n- Shared branches (use merge instead: `git merge origin\u002Fmain`)\n- Critical production code without comprehensive tests\n- When multiple people are pushing to the same branch\n- If you don't understand the conflicts you're seeing\n\n**Default to merge if uncertain.** Merge is safer for collaborative work.\n\n**Use rebase when**: Solo feature branch, clean history matters, no shared dependencies.\n\n## Summary: The Rebase Philosophy\n\nRebasing is a tool for creating clean, linear commit history. **Used well**, it makes debugging and code review easier. **Used poorly**, it loses work.\n\n**The key principle**: Understand every conflict before resolving it. Don't automate away the thinking.\n\nWith this Skill, you can rebase with confidence, understanding each decision and protecting your code throughout the process.\n","# Git Rebase with Intelligent Conflict Resolution\n\n## Quick Start\n\nFor most rebases with multiple commits, use the squash-first strategy to resolve conflicts only once:\n\n```bash\n# Step 1: Backup current state\nbash scripts\u002Fpre-rebase-backup.sh\n\n# Step 2: Squash commits (interactive rebase on current branch)\ngit rebase -i $(git merge-base HEAD origin\u002Fmain)\n\n# Step 3: Rebase onto target\ngit rebase origin\u002Fmain\n\n# Step 4: If conflicts, resolve them once (see workflow below)\n# Then continue: git rebase --continue\n\n# Step 5: Force push safely\ngit push origin $(git rev-parse --abbrev-ref HEAD) --force-with-lease\n```\n\nThis approach resolves conflicts once instead of per-commit, saving time and mental overhead.\n\n## Core Workflow: Conflict Analysis & Resolution\n\nCopy this checklist and mark progress:\n\n```\nRebase Workflow:\n- [ ] Step 1: Create safety backup\n- [ ] Step 2: Fetch latest from target branch\n- [ ] Step 3: Analyze conflict scope\n- [ ] Step 4: Choose resolution strategy\n- [ ] Step 5: Apply conflict resolutions\n- [ ] Step 6: Validate merged code\n- [ ] Step 7: Run tests\n- [ ] Step 8: Force push safely\n```\n\n### Step 1: Create Safety Backup\n\nALWAYS do this first. If rebase goes wrong, you can recover:\n\n```bash\n# Use the bundled script\nbash scripts\u002Fpre-rebase-backup.sh\n\n# Or manually create timestamped backup branch\nTIMESTAMP=$(date +%Y%m%d_%H%M%S)\ngit branch backup-rebase-$TIMESTAMP\n\n# Alternative: Create temporary ref to your current commit\ngit reflog  # Note your current HEAD SHA for manual recovery\n```\n\nThis costs nothing and saves hours of work if something goes wrong.\n\n### Step 2: Fetch Latest Changes\n\nEnsure you have the most recent remote state:\n\n```bash\n# Fetch without modifying local branches\ngit fetch origin\n\n# View the divergence\ngit log --oneline origin\u002Fmain..HEAD  # Your commits\ngit log --oneline HEAD..origin\u002Fmain  # New commits on main\n```\n\nUnderstand how many commits you're rebasing and how much main has changed.\n\n### Step 3: Analyze Conflict Scope\n\nBefore starting the rebase, predict conflicts:\n\n```bash\n# See which files you changed\ngit diff --name-only origin\u002Fmain...HEAD\n\n# See which files main changed\ngit diff --name-only origin\u002Fmain HEAD\n\n# Likely conflict areas: files changed in both\n```\n\n**Key insight**: If you changed `auth.ts` and so did main, you WILL get conflicts in `auth.ts`.\n\nAnticipating conflicts helps you understand how to resolve them.\n\n### Step 4: Choose Resolution Strategy\n\n**For detailed strategy comparison and decision matrix**, see [references\u002Fstrategies.md](references\u002Fstrategies.md).\n\n#### Strategy A: Squash First (Recommended for 3+ commits)\n\n**When to use**: Multiple feature commits with many conflicts expected\n\n**Why**: Reduces conflicts to one resolution phase instead of per-commit\n\n```bash\n# Interactive rebase on current branch first\ngit rebase -i $(git merge-base HEAD origin\u002Fmain)\n\n# In editor, change all \"pick\" to \"squash\" (or 's') except first commit\n# Save and exit - commits are squashed into one\n# Edit commit message to describe the entire feature\n\n# Now rebase the squashed commit\ngit rebase origin\u002Fmain\n\n# Resolve conflicts once, then git rebase --continue\n```\n\n**Tradeoffs**: Lose individual commit history, but simpler conflict resolution\n\n#### Strategy B: Interactive Rebase with Conflict Awareness\n\n**When to use**: 1-2 commits, clean history, or complex per-commit logic\n\n```bash\ngit rebase -i origin\u002Fmain\n\n# In editor, you can:\n# - Reorder commits to isolate conflict-prone ones\n# - Drop commits that are already in main (git detects this)\n# - Combine related commits before rebasing\n\n# Save and exit - rebase proceeds, stopping at conflicts\n```\n\n**Tradeoffs**: More control, but more conflict-resolution iterations\n\n#### Strategy C: Simple Linear Rebase (Fastest, Auto-Resolution)\n\n**When to use**: Simple cases, no critical decisions, or in automated pipelines\n\n```bash\n# Rebase all commits at once\ngit rebase origin\u002Fmain\n\n# If no conflicts, done\n# If conflicts, you resolve each one\n```\n\n**Warning**: Not recommended for complex scenarios. Use Strategies A or B instead.\n\n### Step 5: Apply Conflict Resolutions\n\nWhen `git rebase` pauses with conflicts, use the analysis script:\n\n```bash\n# Analyze conflicts\nbash scripts\u002Fanalyze-conflicts.sh\n\n# See which files conflict\ngit status\n\n# For each conflicted file:\n# - RECOMMENDED: Use merge tool for visual clarity\ngit mergetool --no-prompt\n\n# - ALTERNATIVE: Manual edit in your editor\n# Search for conflict markers: \u003C\u003C\u003C\u003C\u003C\u003C, ======, >>>>>>\n```\n\n#### Conflict Marker Anatomy\n\n```javascript\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\n\u002F\u002F Your current feature code\nfunction authenticate(token) {\n  validateToken(token);\n  return true;\n}\n=======\n\u002F\u002F Main branch code (incoming)\nfunction authenticate(token) {\n  if (!token) throw new Error(\"No token\");\n  validateToken(token);\n  setSession(token);\n  return true;\n}\n>>>>>>> origin\u002Fmain\n```\n\n**Decision framework** (before deleting markers):\n\n1. **Can you keep both?** YES → Merge them intelligently\n\n   ```javascript\n   function authenticate(token) {\n     if (!token) throw new Error(\"No token\"); \u002F\u002F Keep main's validation\n     validateToken(token);\n     setSession(token); \u002F\u002F Keep main's session setup\n     return true; \u002F\u002F Keep feature's return\n   }\n   ```\n\n2. **Conflicting logic?** Understand WHY they differ, then decide\n   - Did main add critical security checks? → Keep main's version\n   - Did your feature add essential functionality? → Keep feature's version\n   - Are they trying to do different things? → Combine intentionally\n\n3. **Lost features?** NEVER let a feature silently disappear\n   - If you added authentication logic, ensure it's in final version\n   - If main improved database access, ensure that's preserved\n\n**For detailed resolution patterns**, see [references\u002Fresolution-patterns.md](references\u002Fresolution-patterns.md).\n\n#### Key Resolution Principles\n\n**✅ DO**:\n\n- Keep both versions' important functionality when possible\n- Use the merge tool for visual representation\n- Add comments explaining merged conflicts: `\u002F\u002F Merged from both versions: main's validation + feature's session setup`\n- Test each file after resolution\n\n**❌ DON'T**:\n\n- Mindlessly pick one version without understanding both\n- Delete conflict markers without understanding the conflict\n- Keep duplicate code - merge intelligently\n- Skip testing before continuing\n\n### Step 6: Validate Merged Code\n\nAfter resolving conflicts, validate the merged code:\n\n```bash\n# Use the validation script\nbash scripts\u002Fvalidate-merge.sh\n\n# Manual checks:\n# 1. Check syntax\nnpm run lint  # or eslint, pylint, etc.\n\n# 2. Check types (if TypeScript)\nnpm run type-check  # or tsc --noEmit\n\n# 3. Spot-check key files\ngit diff HEAD origin\u002Fmain -- \u003Cconflicted-file>\n\n# If validation fails:\n# 1. Fix the issue in the file\n# 2. git add \u003Cfile>\n# 3. git rebase --continue\n```\n\n**Important**: Validation catches mistakes BEFORE you commit them.\n\n### Step 7: Run Tests\n\nThis is your safety net:\n\n```bash\n# Run full test suite\nnpm test\n\n# Or specific tests for changed areas\nnpm test -- --testPathPattern=auth  # If auth.ts was changed\n\n# If tests fail:\n# 1. Understand what broke\n# 2. Fix in the files\n# 3. git add \u003Cfiles>\n# 4. git rebase --continue\n```\n\n**Rule**: Never force-push code that fails tests.\n\n### Step 8: Force Push Safely\n\nUse `--force-with-lease` instead of `--force`. It protects against accidentally overwriting others' work:\n\n```bash\n# SAFE: Protects others' commits\ngit push origin $(git rev-parse --abbrev-ref HEAD) --force-with-lease\n\n# UNSAFE: Can overwrite others' work\ngit push origin your-branch -f  # Don't do this\n\n# If force-with-lease fails:\n# Someone else pushed to your branch\n# Coordinate with them before forcing\n```\n\n## Common Scenarios & Strategies\n\n### Scenario 1: Many Small Conflicts Across 5+ Commits\n\n**Use**: Squash-first strategy\n\n```bash\ngit rebase -i $(git merge-base HEAD origin\u002Fmain)\n# Mark all but first commit as 's' (squash)\n# Save - commits squash into one\n\ngit rebase origin\u002Fmain\n# Resolve conflicts once\ngit rebase --continue\n\n# Only one conflict-resolution phase!\n```\n\n**Why**: Each commit might have conflicts. Squashing before rebasing means one pass.\n\n### Scenario 2: One Specific Commit Has Conflicts\n\n**Use**: Target that commit with interactive rebase\n\n```bash\ngit rebase -i origin\u002Fmain\n\n# In editor, move the problematic commit to the end\n# Save - rebase proceeds, stopping at that commit\n\n# When it stops, you know exactly which commit conflicts\ngit status  # See what changed in this commit\n\n# Resolve, then continue\ngit rebase --continue\n```\n\n**Why**: Isolating the commit helps you understand what it's trying to do.\n\n### Scenario 3: Conflicts Keep Repeating (Same File, Different Commits)\n\n**Use**: Git rerere (reuse recorded resolution)\n\n```bash\n# Enable rerere globally (one-time setup)\ngit config --global rerere.enabled true\n\n# Now when you hit the same conflict in a second commit,\n# Git automatically applies the first commit's resolution\n\ngit rebase origin\u002Fmain\n\n# Git remembers your first conflict resolution\n# and replays it automatically for similar conflicts\n```\n\n**Why**: When rebasing and hitting the same file repeatedly, rerere saves manual work.\n\n### Scenario 4: Rebase Conflicts Are Too Complex\n\n**Emergency escape plan**:\n\n```bash\n# Abort the rebase - return to original state\ngit rebase --abort\n\n# Fall back to merge (safer for complex scenarios)\ngit merge origin\u002Fmain\n\n# Or try a different approach:\n# - Squash your entire feature branch first\n# - Cherry-pick main's critical changes selectively\n```\n\n**Important**: It's okay to abort and rethink. Better than a broken rebase.\n\n## Bundled Scripts\n\nThis skill includes helper scripts in `scripts\u002F`:\n\n- **`pre-rebase-backup.sh`**: Creates a safety backup before rebasing\n- **`analyze-conflicts.sh`**: Analyzes current conflicts and provides detailed information\n- **`validate-merge.sh`**: Validates that merge\u002Frebase is clean and ready for testing\n\nRun scripts with `bash scripts\u002F\u003Cscript-name>.sh`.\n\n## Reference Files\n\nFor detailed information on specific topics:\n\n- **Strategies**: [references\u002Fstrategies.md](references\u002Fstrategies.md) - Complete strategy comparison and decision matrix\n- **Resolution Patterns**: [references\u002Fresolution-patterns.md](references\u002Fresolution-patterns.md) - Common conflict resolution patterns and heuristics\n- **Troubleshooting**: [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md) - Solutions to common rebase problems\n- **Automation**: [references\u002Fautomation.md](references\u002Fautomation.md) - Automated conflict resolution for CI\u002FCD\n- **Scripts & Tools**: [references\u002Fscripts-tools.md](references\u002Fscripts-tools.md) - Additional git commands and tool usage\n\n## Checklist: Before You Commit to Rebasing\n\n- [ ] Understand why you're rebasing (cleaner history, syncing with main, etc.)\n- [ ] Backup your current branch: `bash scripts\u002Fpre-rebase-backup.sh`\n- [ ] Run tests on current branch - they should pass\n- [ ] Fetch latest: `git fetch origin`\n- [ ] Understand what you'll be rebasing (5 commits? 50?)\n- [ ] Understand main's recent changes (1 commit? Major refactor?)\n- [ ] Choose your strategy (see [references\u002Fstrategies.md](references\u002Fstrategies.md))\n- [ ] Have your merge tool ready (if using GUI)\n- [ ] Block 30 mins - don't rush conflict resolution\n- [ ] Have tests ready to run after rebase\n\n## When NOT to Rebase\n\n- Shared branches (use merge instead: `git merge origin\u002Fmain`)\n- Critical production code without comprehensive tests\n- When multiple people are pushing to the same branch\n- If you don't understand the conflicts you're seeing\n\n**Default to merge if uncertain.** Merge is safer for collaborative work.\n\n**Use rebase when**: Solo feature branch, clean history matters, no shared dependencies.\n\n## Summary: The Rebase Philosophy\n\nRebasing is a tool for creating clean, linear commit history. **Used well**, it makes debugging and code review easier. **Used poorly**, it loses work.\n\n**The key principle**: Understand every conflict before resolving it. Don't automate away the thinking.\n\nWith this Skill, you can rebase with confidence, understanding each decision and protecting your code throughout the process.\n",{"name":5,"metadata":24,"description":7},{"author":25,"github":26,"repository":27},"Pedro Nauck","https:\u002F\u002Fgithub.com\u002Fpedronauck","https:\u002F\u002Fgithub.com\u002Fpedronauck\u002Fskills","main","a5b533be2d244bbf3e5606e851742f0e0ba99423","skills\u002Fcurated\u002Fgit-rebase","https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills","https:\u002F\u002Fgithub.com\u002Fharyelramalho","linkedin.com\u002Fin\u002Fharyelramalho\u002F","Software Engineer @ SKORR •  Former Vice President of the Junior Computer Association - TecnoJr","2026-07-16 01:34:58",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add haryelramalho\u002Fskills --skill git-rebase",{"tool":42,"command":43},"bunx","bunx skills add haryelramalho\u002Fskills --skill git-rebase",{"tool":45,"command":46},"pnpm","pnpm dlx skills add haryelramalho\u002Fskills --skill git-rebase","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002FSKILL.md",true,[50,56,60,64,68,72,78,82],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fautomation.md","REFERENCE","参考文档",692,"https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002Freferences\u002Fautomation.md",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fresolution-patterns.md",1886,"https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002Freferences\u002Fresolution-patterns.md",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fscripts-tools.md",1185,"https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002Freferences\u002Fscripts-tools.md",{"path":65,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fstrategies.md",8394,"https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002Freferences\u002Fstrategies.md",{"path":69,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Ftroubleshooting.md",1502,"https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002Freferences\u002Ftroubleshooting.md",{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"scripts\u002Fanalyze-conflicts.sh","SCRIPT","脚本",2940,"https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002Fscripts\u002Fanalyze-conflicts.sh",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"scripts\u002Fpre-rebase-backup.sh",2408,"https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002Fscripts\u002Fpre-rebase-backup.sh",{"path":83,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":84,"sourceHtmlUrl":85},"scripts\u002Fvalidate-merge.sh",3109,"https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fgit-rebase\u002Fscripts\u002Fvalidate-merge.sh",[87,94,101,108,115,122],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M753YDMKSDB7320THEQ2CVW5","to-prompt-opus","Use when preparing or rewriting prompts for Claude Opus 4.8, Anthropic API agents, XML-structured prompts, long-context document work, coding agents, research synthesis, frontend\u002Fdesign tasks, or model-specific prompt optimization. Do not use for GPT\u002FOpenAI prompts or raw context packaging without Opus-specific tuning.","https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmine\u002Fto-prompt-opus\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M753YAP95W4K2MCEAEEAV6YA","to-prompt-gpt","Use when preparing or rewriting prompts for GPT-5.5, OpenAI API agents, Responses workflows, coding agents, research synthesis, support assistants, or model-specific prompt optimization. Do not use for Claude\u002FOpus prompts or raw context packaging without GPT-specific tuning.","https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmine\u002Fto-prompt-gpt\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M753Y700AZ0GVJDNW9Q1Q54F","plan-refactor-qa","Plans and runs qa-report before executing Compozy refactor tasks. Use when the user provides a refactor or issue slug and wants Codex to inspect the matching .compozy\u002Ftasks directory, related PRD\u002FTechSpec\u002FADR\u002Ftask artifacts, affected code, and existing tests, then invoke $qa-report with a repository-grounded prompt. Do not use to run tests, execute qa-execution, implement code, or perform post-refactor verification.","https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmine\u002Fplan-refactor-qa\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M753XZENG0Z8S2ET75EM8CGB","multi-tool-branch-review","Orchestrates a multi-tool branch review of the current git branch against a base branch. By default it runs two independent thermo-nuclear maintainability audits, one on Codex GPT-5.5 xhigh and one on Claude Opus xhigh, then consolidates the findings into a single remediation plan via writing-plans. If the user explicitly asks for native reviews, it can add the Claude native review pass, the Codex native review pass, or both. Use when the user wants a deep cross-model review of a branch or PR before merge, or asks to review this branch with multiple tools or models. Encodes known infra failure modes and their fixes (missing Claude ACP adapter, Codex MCP auth hangs, false-positive report files, long jobs orphaned inside subagents). Do not use for reviewing a single uncommitted snippet, for non-git work, for running only one reviewer, or when the user only wants a quick lint or test run.","https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmine\u002Fmulti-tool-branch-review\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":19},"01M753XQM40XCK55BH5WPA88EW","create-pr-with-template","Create a GitHub Pull Request with gh CLI and prefer repository PR templates automatically. Use this whenever the user asks to open\u002Fcreate a PR, especially when template compliance is needed. If multiple templates exist, ask the user which template to use.","https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmine\u002Fcreate-pr-with-template\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":19},"01M753XJMBJ8VFPRCDCC1JJ9G4","ui-craft","Provides guardrails for user-facing UI work: usability heuristics, accessibility floors, design-system discipline, component states, microcopy, motion, dark mode, responsive behavior, and human-AI UX. Use when designing, generating, reviewing, or refactoring visible product surfaces such as components, pages, dashboards, forms, dialogs, loading\u002Fempty\u002Ferror states, or AI interfaces. Do not use for backend-only work, infrastructure, CLI\u002FTUI design, or pure documentation editing.","https:\u002F\u002Fgithub.com\u002Fharyelramalho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated\u002Fui-craft\u002FSKILL.md",[],[]]