git-feature-branch-sync

Synchronize a divergent Git feature branch with the remote default branch.

4|1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/jcdendrite/claude-config --skill git-feature-branch-sync
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-feature-branch-sync
Source: https://github.com/jcdendrite/claude-config/tree/main/claude/.claude/skills/git-feature-branch-sync
Command: npx skills add https://github.com/jcdendrite/claude-config --skill git-feature-branch-sync

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you keep your feature branch aligned with the default branch while avoiding unsafe force-pushes, preserving history rules, and minimizing review disruption.

Core Features & Use Cases

  • Divergence detection: Uniformly checks whether your branch is behind the default branch using a trial-merge/divergence strategy so decisions are consistent across hooks and gates.
  • Rebase vs merge decisioning: Recommends rebase for personal, clean branches and merge-main when conflicts, stacking, review-anchored comments, or per-project policy make rebase risky.
  • Force-push safety controls: Guides use of --force-with-lease/--force-if-includes while explicitly refusing to force-push protected targets (default branch, shared branches, and tags).

Quick Start

Use the git-feature-branch-sync skill to determine whether to rebase or merge your feature branch onto the latest default-branch tip and to push updates with the safest force-push option allowed.

Frequently Asked Questions about git-feature-branch-sync

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

FAQPage Schema
How do I safely sync a feature branch with the default branch?

Sync a divergent Git feature branch by detecting divergence with a trial-merge, then selecting rebase or merge based on conflicts and policy, and pushing with safe flags like --force-with-lease.

When should I rebase vs merge my feature branch?

Choose rebase for personal clean branches, but switch to merge-main when conflicts, stacking, review-anchored comments, or per-project repository policies make rebase risky.

Is it safe to force-push a feature branch during rebase?

Force-push is safe on feature branches when using --force-with-lease or --force-if-includes, but you must never force-push protected targets like the default branch, shared branches, or tags.

Why does my feature branch sync fail with a force-push?

Your feature branch sync fails because force-push is explicitly refused on protected targets including the default branch, shared branches, and tags to preserve history rules and minimize review disruption.

What is the best way to align a stacked feature branch with main?

Align a stacked feature branch using merge-main rather than rebase, because stacking and review-anchored comments make rebase risky and can disrupt the pull request review process.