sync-branch

Merge git branches with conflict resolution and workspace restoration.

2|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/mostafa-drz/claude-skills --skill sync-branch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-branch
Source: https://github.com/mostafa-drz/claude-skills/tree/main/code/sync-branch
Command: npx skills add https://github.com/mostafa-drz/claude-skills --skill sync-branch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Merges one git branch into another with conflict handling, preserving work in progress and restoring state, enabling reliable synchronization of long-lived branches with upstream.

Core Features & Use Cases

  • Stashes uncommitted work, updates both branches from the remote, performs a merge, and resolves conflicts while preserving changes from both sides.
  • Useful for keeping feature or release branches aligned with their upstreams in collaborative workflows and automated release pipelines.
  • Handles push-back of updated branches and restores the original working branch after the operation.

Quick Start

Run /sync-branch to merge your default source into your current branch.

Frequently Asked Questions about sync-branch

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

FAQPage Schema
How do I automatically merge a git branch to keep it in sync with upstream?

Keeping a git branch in sync with upstream is automated by stashing uncommitted work, fetching remote updates for both branches, performing the merge, pushing results, and restoring the original workspace.

What happens to uncommitted work when merging branches in a git workflow?

Uncommitted work is safely stashed before the merge begins. Once the branch synchronization is complete and results are pushed, the original working branch and stashed changes are automatically restored to preserve your progress.

How are merge conflicts resolved when synchronizing long-lived branches?

Merge conflicts during branch synchronization are resolved according to a selected strategy, preserving changes from both sides to ensure long-lived feature and release branches stay aligned without losing data.

Can I use automated branch merging for release pipelines across teams?

Yes, automated branch merging is designed for collaborative workflows and automated release pipelines where long-lived branches must stay aligned across teams, handling the full remote update and push-back lifecycle.

What is the best way to update a feature branch from a remote repository without losing local changes?

The best way to update a feature branch without losing local changes is to use an automated workflow that stashes your work, updates the branch from the remote, merges changes, and restores your stashed progress seamlessly.