Skip to content
Agentmart
Submit a tool

rebase-staging

Rebase the current Git branch onto the latest remote staging branch and safely force-push it.

Skill by hmdghoul

IndexedApache-2.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/hmdghoul-rebase-staging

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Rebase the current Git branch onto the latest remote staging branch and safely force-push it.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/rebase-staging

What's inside

Skill name
rebase-staging
Description
Rebase the current Git branch onto the latest remote staging branch and safely force-push it.
License
Apache-2.0
Instructions
12 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

Rebase the current branch onto the latest `origin/staging` and force-push it with `--force-with-lease`. Invoking this skill approves the whole flow; do not pause to confirm steps. If a step fails in a way not covered here, stop and report. Do not improvise.

1. `git branch --show-current`. If it is empty (detached HEAD) or `staging`, `main` or `master`, stop and tell the user.
2. `git status --porcelain --untracked-files=no`. If there is any output, stop and ask the user to commit or stash. Never auto-stash. Untracked files (e.g. a deliberately untracked `feature-docs/`) don't block: git refuses the rebase on its own if one would be overwritten.
3. `git fetch origin staging`
4. `git pull --ff-only origin "$(git branch --show-current)"` brings in remote-only commits so the later push isn't rejected as `stale info`. Name the branch: a bare `git pull` uses the upstream, which may be `staging`, and `origin HEAD` resolves on the remote. A never-pushed branch errors harmlessly, so continue. If it can't fast-forward (diverged), stop and report without forcing anything.
5. `git log --oneline origin/staging..HEAD`. If it is empty, the branch has no commits of its own: stop and report. Rebasing and force-pushing it is a no-op at best.
6. `git rebase --gpg-sign origin/staging`. The flag is required: repos with a signed-commits ruleset reject unsigned commits on push (GH013), and a plain rebase can rewrite the branch's commits unsigned. Resolve conflicts yourself rather than reporting them. For each file, read both sides, work out the intent of each change, and edit to a correct result that keeps both. Then `git add` it and `git rebase --continue` (the flag carries over), and repeat. Use `git rebase --abort` only as a last resort, when a conflict can't be resolved safely, then report what blocked it.
7. `git log --format='%G? %h %s' origin/staging..HEAD`. Every line must start with `G`. If any doesn't, stop and report before pushing.
8. `git push --force-with-lease origin HEAD`. The target is explicit because a bare push goes to the upstream, which may be `staging`. The lease still refuses if the remote moved.

From hmdghoul/claude-code-global-config, Apache-2.0.

More from hmdghoul/claude-code-global-config

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 10, 2026 (18 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from hmdghoul

Cite this page

rebase-staging skill. Agent Mart. https://agentmart.dev/skills/hmdghoul-rebase-staging (last updated 2026-10-24)