update-branch

Synchronize feature branches with their PR base using git and gh.

3|1|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/nsheaps/ai-mktpl --skill update-branch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: update-branch
Source: https://github.com/nsheaps/ai-mktpl/tree/main/plugins/scm-utils/skills/update-branch
Command: npx skills add https://github.com/nsheaps/ai-mktpl --skill update-branch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Synchronize a feature branch with its remote and its PR base to ensure local commits are preserved, remote branches are current, and pull requests remain up-to-date and mergeable.

Core Features & Use Cases

  • Branch synchronization: Fetch all remotes, checkout the feature branch, merge the PR base into the feature branch, pull remote changes, and push the updated branch.
  • Conflict resolution guidance: Distinguish obvious from non-obvious conflicts and delegate analysis and strategy to specialized agents when needed, with a documented verification workflow.
  • CI and safety rules: Operates in local and CI environments, avoids history rewrites, restricts modifications to the requested branch, and verifies PR state via GitHub CLI.

Quick Start

Update the current branch from its PR base and push the result to origin.

Frequently Asked Questions about update-branch

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

FAQPage Schema
How do I sync a feature branch with its base branch to keep a pull request up-to-date?

To sync a feature branch, the workflow fetches remotes, checks out the branch, merges the PR base into it, pulls remote changes, and pushes the updated branch. This preserves local commits and keeps the pull request current and mergeable without rewriting history.

What's the best way to resolve merge conflicts when updating a Git branch?

Merge conflict resolution distinguishes obvious conflicts from non-obvious ones and delegates complex analysis to specialized agents. It provides strategy guidance and a documented verification workflow to safely resolve conflicts during branch synchronization.

Can I update a GitHub pull request branch from a CI pipeline without rewriting history?

Yes, branch synchronization works in CI environments and local developer setups. It fetches remotes, merges the base branch, and pushes updates while explicitly avoiding history rewrites and restricting modifications to the requested branch.

Why does updating a feature branch preserve my local commits instead of rebasing them?

Updating a feature branch preserves local commits by using merge operations instead of rebase. This approach fetches the PR base, merges it into the feature branch, and pushes the result, ensuring commit history remains intact and remote branches stay current.

Does branch synchronization verify pull request status after pushing updates to origin?

Yes, after merging the base and pushing the updated branch, the workflow verifies the pull request status using the GitHub CLI. This confirms the PR is mergeable and that remote synchronization completed successfully.