safe-push

Fetch, conditionally rebase, run tests, and push committed Git changes.

289|39|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/kxn/codex-remote-feishu --skill safe-push-kxn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safe-push
Source: https://github.com/kxn/codex-remote-feishu/tree/main/.codex/skills/safe-push
Command: npx skills add https://github.com/kxn/codex-remote-feishu --skill safe-push-kxn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pushing commits can fail when the remote branch has advanced. This skill provides a safe, repeatable workflow that fetches, rebases when needed, reruns tests after a rebase, and only then pushes, reducing failed pushes and manual intervention.

Core Features & Use Cases

  • Safe push path: fetch target, rebase if needed, run tests after rebasing, then push.
  • Guardrails: do not auto-resolve conflicts; require manual review after rebase if drift is detected.
  • Flexible variants: supports pushing non-default branches, custom test commands, and optional test execution.

Quick Start

Run the safe-push helper from the repository root to push safely.

Frequently Asked Questions about safe-push

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely rebase and run tests before a git push?

To safely rebase and run tests before a git push, you need a workflow that fetches remote changes, applies a conditional rebase, runs automated test verifications, and pauses for manual review if drift is detected.

Why does my git push fail when the remote branch has advanced?

Your git push fails when the remote branch has advanced because local commits diverge from the remote history. A safe push workflow resolves this by fetching updates and conditionally rebasing your local commits before pushing.

What is the best way to automate git fetch, rebase, and testing workflows?

The best way to automate a git fetch, rebase, and testing workflow is using a safe push helper that coordinates these steps sequentially, requires a clean worktree, and supports specifying custom test commands.

Can I use a safe push workflow for non-default branches with custom test commands?

Yes, you can use a safe push workflow for non-default branches with custom test commands. This flexible approach supports optional test execution and allows specifying target branches during the push operation.

Does safe push auto-resolve git rebase conflicts?

No, safe push does not auto-resolve git rebase conflicts. It requires a clean worktree and mandates a manual audit to resolve any detected drift, ensuring you review changes instead of automatically committing potentially broken code.

When do I need to rerun tests after rebasing local git commits?

You need to rerun tests after rebasing local git commits when the remote branch has advanced and a rebase is applied. This ensures the newly integrated code still passes verifications before the final push.