mp-sync-base

Merge a target branch into the current branch with Git safety checks.

1|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/MartinoPolo/mpx-claude-code --skill mp-sync-base
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mp-sync-base
Source: https://github.com/MartinoPolo/mpx-claude-code/tree/main/skills/mp-sync-base
Command: npx skills add https://github.com/MartinoPolo/mpx-claude-code --skill mp-sync-base

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeps a feature or working branch up to date by merging changes from a target branch (such as main or dev) while preventing surprises from uncommitted work, missing tracking branches, or upstream divergence.

Core Features & Use Cases

  • Target branch detection: Uses an explicitly provided branch argument, or falls back to a mp-base-branch-detector sub-agent to infer likely remote base branches.
  • Pre-merge safety checks: Detects uncommitted changes and prompts to stash; checks whether the current branch is behind, ahead, diverged, or in sync with its remote tracking branch.
  • Merge with conflict handling: Fetches and previews incoming commits, performs the merge, and guides resolution for conflicts using analysis of conflict markers and iterative resolution.

Quick Start

Run mp-sync-base to merge the target branch (for example, main) into your current branch while it checks status, sync state, and resolves conflicts if needed.

Frequently Asked Questions about mp-sync-base

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

FAQPage Schema
How do I safely merge a base branch into my current feature branch?

To merge a base branch safely, the process fetches remote updates, previews incoming commits, and runs pre-merge checks for uncommitted work. It then executes the branch merge and guides you through conflict resolution using marker analysis.

What happens to uncommitted changes when syncing a feature branch with main?

When syncing a feature branch with main, pre-merge safety checks detect uncommitted changes and prompt you to stash them. This prevents losing local work before fetching and executing the upstream merge.

How do I resolve merge conflicts after pulling updates from a remote base branch?

To resolve merge conflicts after pulling updates, the process analyzes Git conflict markers and provides iterative resolution guidance. This helps you systematically address divergent code sections introduced during the branch sync.

Do I need a tracking remote configured to update my branch from upstream changes?

You need a tracking remote configured to automatically push the merge result after syncing upstream changes. The process checks whether your branch is ahead, behind, or diverged from its remote tracking branch before executing the merge.

Can I automatically detect the target branch when merging dev into a feature branch?

You can automatically detect the target branch when merging dev into a feature branch by falling back to a base-branch detector. This sub-agent infers the likely remote base branch if you do not explicitly provide one as an argument.

What is the best way to preview incoming commits before merging main into my working branch?

The best way to preview incoming commits before merging main into your working branch is to use a Git workflow that fetches the remote and displays the commit log. This lets you review upstream changes before executing the actual merge.