Sync force to

From Takazudo/claude-resources · View interactive version

Sync force to is an AI agent skill from the GitHub repository Takazudo/claude-resources. Force-sync the current branch into a target branch by deleting and re-pushing it, with a backup PR first. Use when /sync-to fails on conflicts, or for 'sync force to' / 'force push to branch'.

How to use this skill

Skill file

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:

  1. Pushes the old target state as a backup/YYYYMMDDHHMM-<target> branch
  2. Creates a PR for the backup branch against the default branch
  3. Closes the PR and deletes the backup branch
  4. 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.

Usage

Normal mode

Run the bundled script:

bash $HOME/.claude/skills/sync-force-to/scripts/sync-force-to.sh $ARGUMENTS

Report the script output to the user verbatim. Do not add extra commentary unless there was an error.

Setup mode (`--setup`)

When $ARGUMENTS is --setup, do NOT run the script. Instead, configure the current project's GitHub Actions workflows to skip CI on backup/* branches:

  1. Find all workflow files: .github/workflows/*.yml and .github/workflows/*.yaml
  2. For each workflow file, check on: triggers (push, pull_request, etc.)
  3. For each trigger that could run on backup/** branches:
  1. Report what files were changed

Important notes for setup:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.