oocx/tfplan2md

git-rebase-main

Safely rebase the current feature branch on top of the latest origin/main. Use when preparing a branch for PR, UAT, or release.

First seen Feb 24, 2026

Installation

$ npx skills add oocx/tfplan2md --skill git-rebase-main

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from oocx/tfplan2md · top by installs.

npx skills add oocx/tfplan2md

Browse all from oocx/tfplan2md

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 172
License LICENSE
Default branch main
Open issues 26
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,823 B
  • docs SUMMARY.md 150 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 24 installs

SKILL.md

Git Rebase Main

Purpose

Ensure the current feature branch includes all the latest changes from main before proceeding with code review, UAT, or release. This prevents merge conflicts and ensures tests run against the latest codebase.

Hard Rules

Must

  • Fetch from origin before rebasing.
  • Handle rebase conflicts by stopping and reporting to the user.
  • Verify the branch is not main before rebasing.

Must Not

  • Force-push without user confirmation.
  • Rebase if there are uncommitted changes.

Actions

1. Pre-flight Checks

# Ensure we're not on main
current_branch=$(git branch --show-current)
if [[ "$current_branch" == "main" ]]; then
  echo "ERROR: Cannot rebase main onto itself. Switch to a feature branch first."
  exit 1
fi

# Ensure working directory is clean
if [[ -n "$(git status --porcelain)" ]]; then
  echo "ERROR: Working directory has uncommitted changes. Commit or stash them first."
  exit 1
fi

2. Fetch and Rebase

git fetch origin
git rebase origin/main

3. Handle Conflicts

If the rebase fails due to conflicts:

  1. Report the conflicting files to the user.
  2. Do NOT attempt to auto-resolve.
  3. Wait for user to resolve and run git rebase --continue.

4. Force Push (with confirmation)

After a successful rebase, the branch history has changed. Ask the user before force-pushing:

git push --force-with-lease origin HEAD

Golden Example

$ git fetch origin && git rebase origin/main
First, rewinding head to replay your work on top of it...
Applying: feat: add new formatting option
$ git push --force-with-lease origin HEAD