sync-force-to
Installation
SKILL.md
DO NOT auto-invoke this skill. This destructively overwrites a remote branch. Always ask for user confirmation before proceeding.
sync-force-to
Overwrite a remote target branch with the current branch by deleting the remote target and re-pushing. Avoids git push --force by using delete + push instead.
Before overwriting, the script automatically:
- Pushes the old target state as a
backup/YYYYMMDDHHMM-<target>branch - Creates a PR for the backup branch against the default branch
- Closes the PR and deletes the backup branch
- The closed PR retains GitHub's "Restore branch" button for recovery
If the target branch doesn't exist yet (first-time push), backup steps are skipped.