Generated banner for Git Merge
Generated logo for Git Merge

Git Merge

MicrosoftOfficialPublished by Microsoft

  • Skill
  • Tool integration
  • Software development
  • MIT
  • No issues found

From the author

Integrate branches with merge or rebase, resolve conflicts, and execute an ordinary push when explicitly authorized. Use for guided integration with optional conflict-review pauses.
— the description by Microsoft

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The git-merge skill provides a structured, traceable process for integrating branches using merge or rebase operations. It enforces best practices by ensuring the working tree is clean before starting, documenting conflict resolutions with rationales, and providing an optional pause for user review during complex conflict resolution. The skill supports standard merges, rebases, and rebase-onto operations, and handles push authorization explicitly to prevent unauthorized remote history changes.

What it does

  • Performs git merge, rebase, or rebase-onto operations.
  • Ensures a clean working tree by stashing local changes before integration.
  • Provides a guided conflict resolution process with documentation of rationales.
  • Offers an optional conflict-stop mode to pause for user review after resolving conflicts.
  • Summarizes integration results, including conflict resolutions and stash states.
  • Executes authorized pushes only when explicitly requested by the user.

When to use it

  • When you need to integrate changes from one branch into another.
  • When you anticipate complex merge conflicts that require careful review.
  • When you need to maintain a clean, documented history of integration steps.
  • When you want to perform a rebase-onto operation to move a specific range of commits.

Advantages

  • Reduces errors through a standardized, step-by-step integration workflow.
  • Improves traceability by requiring rationales for conflict resolutions.
  • Prevents accidental pushes by requiring explicit authorization.
  • Provides flexibility with optional review pauses during conflict resolution.

Usage examples

“Merge the feature-login branch into main.”
The agent will prepare the workspace, perform the merge, resolve any conflicts, and provide a summary of the integration.
“Rebase my current branch onto develop with conflict-stop enabled.”
The agent will initiate the rebase and pause after resolving conflicts to allow you to review the changes before continuing.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/microsoft/git-merge/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip git-merge.zip -d .agents/skills

Documentation by Microsoft

Git Merge and Rebase

Goal

Run a merge, rebase, or rebase --onto sequence from the current branch with explicit inputs, optional review pauses, and a completion summary. Follow every step even when the repository appears clean so results stay consistent and traceable.

Conventions

Read references/merge-conventions.md and follow its integration, authorization, account-change, and execution-evidence rules.

Inputs

  • operation (optional, default merge): merge, rebase, or rebase-onto.

  • branch (required): the branch or ref to merge, or the rebase target. Ask for it when it is missing.

  • onto (required for rebase-onto): the new base.

  • upstream (optional, used by rebase-onto): the branch or commit that bounds the commits to move.

  • conflict-stop (optional, default false): when true, pause after each set of conflict fixes for user review before continuing.

Flow

  1. Resolve the inputs. Ask for branch when it is missing, and for onto when operation is rebase-onto. Record the active branch and the inputs.

  2. Prepare the workspace as the merge conventions define, then run the command they define for the selected operation and capture its output. Without conflicts, continue at step 5.

  3. Resolve conflicts as the conventions define, and keep each file's resolution and rationale for the summary.

  4. Honor review pauses. When conflict-stop is true, summarize the fixes with a checklist of touched files and wait for explicit user confirmation before continuing. Answer follow-up questions and adjust resolutions from user feedback.

  5. Continue or complete the operation as the conventions define, or abort when the user directs it.

  6. Execute an authorized ordinary push under those conventions; otherwise leave the result local without soliciting publishing approval. Summarize the integration, linked conflict resolutions, stash state, actual push/account-cleanup outcomes when applicable, and remaining follow-up.

Success Criteria

  • The operation path completed with every conflict resolved, or was aborted at the user's direction.

  • git status --short reports no pending changes, or the summary names deliberate follow-up items.

  • The summary links conflict resolutions and accurately reports integration and any authorized push or account cleanup.

Files

references/merge-conventions.md


description: "Git integration and explicit ordinary-push authorization. Use when merging, rebasing, resolving conflicts, or pushing a branch."

Git Merge and Rebase Conventions

<!-- cspell:ignore refspec -->

Execute the Git operations the user requests or approves, within the limits below; do not ask for the same approval again. Authorization covers the agreed task and its expected result, not unrelated actions.

Apply Prepare through Finish only to integration work. A push-only request does not start integration or require a clean working tree. The /git-merge skill adds guided inputs and optional review pauses.

Prepare

  • Confirm a clean working tree with git status --short. Stash local changes first, and do not proceed while unrelated changes are staged.

  • Fetch the latest remote refs when the target might lag, such as git fetch origin <branch> or git fetch --all --prune.

  • Record the active branch and the target ref, and run Git commands in the terminal.

Run the Operation

  • Merge: git merge --no-edit <branch> from the current branch.

  • Rebase: git rebase --empty=drop --reapply-cherry-picks <branch>.

  • Rebase onto: git rebase --onto <onto> <upstream> <branch> after verifying that every referenced commit exists. Check git rebase --help for --onto semantics and conflict continuation.

Resolve Conflicts

  • List conflicted files with git status --short, and use git diff and git log --merge for the context behind each side.

  • Inspect each conflicted file individually, including automatic resolutions. Use repository conventions, related instructions files, domain knowledge, and workspace tools such as Terraform, Bicep, or documentation search. Review related code and references before choosing a resolution, and consult official Git or domain documentation when a resolution is uncertain.

  • Apply focused edits that remove the markers, stage each file with git add <file>, and confirm with git diff --staged and git status --short that only intended files are staged.

  • Document every resolution with a brief rationale and a link to each edited file.

Finish

  • Continue with git merge --continue or git rebase --continue, or back out with git merge --abort or git rebase --abort when required.

  • Confirm a clean tree with git status --short, and list the new commits with git log --oneline -5.

  • Pop any stash created during preparation, and tell the user when the pop conflicts.

Push Authorization

  • Execute an explicitly requested or approved ordinary push. A request to integrate then push authorizes both; integration, conflict resolution, commits, or PR preparation alone do not.

  • Use the established repository, source, push endpoint, and destination branch. Ask only for genuinely missing or materially changed scope; other remotes or accounts alone are not ambiguity.

  • Keep the push to the authorized branch and endpoint. Check effective configuration for extra refs, tags, mirrors, or destinations; do not silently expand scope or change configuration.

  • Never force-push or rewrite remote history here, including --force-with-lease or a leading-plus refspec. Do not delete remote refs or bypass hooks or repository protections.

  • On rejection, report the result and stop unless recovery is already authorized. Rejection grants no permission for a stronger push, extra integration, another destination, or an account change.

Account Changes

  • Change accounts or authentication configuration only at the user's direction. GitHub CLI account selection does not establish Git transport identity.

  • For a temporary switch, establish the original account/host and requested target before switching. Restore the original in unconditional cleanup (try/finally or equivalent), checking native results, even if switching or pushing fails or is cancelled.

  • Verify restoration and report it separately from the push. If cleanup or verification cannot complete, report incomplete restoration and the known or unknown remaining account state.

Execution Evidence

  • Report an attempt only after Git launches, and publication only when results confirm the intended ref changed. An up-to-date result is not new publication.

  • Distinguish instruction/tool restrictions and unavailable tooling from observed authentication, network, or repository failures. Report only supported causes, preserve uncertainty, and keep credentials and secret-bearing URLs out of reports.

Requirements and compatibility

Written for: GitHub Copilot, Claude Code

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Claude Code frontmatter

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Microsoft
Publisher
Microsoft (Official)
Source
microsoft/hve-core · .github/skills/hve-core/git-merge · commit f425e94
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Microsoft or Microsoft.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download git-merge.zip