
Merge Changes
OfficialFreeSeamlessly merge your topic branch into the base branch.
Free · Opens the source repo
What Merge Changes does
The Merge Changes skill is designed to facilitate the merging of a topic branch into the base branch within a Git repository. This skill is particularly useful for developers who want to consolidate their work from a feature branch back to the main codebase while ensuring that the process adheres to best practices. It automates the necessary steps to commit uncommitted changes, perform the merge, and handle any potential conflicts that may arise during the merging process.
The workflow begins by checking for any uncommitted changes in the current worktree. If there are changes, it prompts the user to commit them before proceeding. Once the worktree is clean, the skill executes the merge command, integrating the changes from the topic branch into the base branch. If merge conflicts occur, the skill provides a structured approach to identify and resolve these conflicts, ensuring that the developer maintains the integrity of both branches.
After resolving conflicts, the skill commits the merge and validates the outcome by checking that the main worktree is clean and that the topic branch is an ancestor of the base branch. This thorough validation process helps to confirm that all changes have been successfully merged, reducing the risk of issues in the codebase.
This skill is ideal for developers working in collaborative environments where multiple branches are common. It streamlines the merging process, minimizes the chance of errors, and encourages adherence to Git best practices, making it a valuable addition to any developer's toolkit.
When to use it
Use this skill when you want to merge changes from a feature branch back into the main branch while ensuring a clean and conflict-free integration.
When not to use it
This skill may not be suitable for situations involving complex merge strategies or when extensive manual intervention is required for conflict resolution.
What you can build with it
Merging Feature Branches
Use this skill to merge completed feature branches back into the main branch after development is finished.
Handling Merge Conflicts
When conflicts arise during a merge, this skill guides you through resolving them while maintaining code integrity.
Ensuring Clean Merges
This skill validates the merge process, ensuring that all changes are integrated correctly before finalizing.
How to install Merge Changes
View source1. Install with the skills CLI
npx skills add microsoft/vscode/merge --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by microsoftMerge Changes
Merge the topic branch (checked out in the current worktree) into the merge base branch (checked out in the main worktree). The context block appended to the prompt contains the source branch, target branch, and main worktree path.
Guidelines
- Never force-push (
--force,--force-with-lease) without explicit user approval. - Never skip pre-push hooks (do not use
--no-verify). - Never rewrite or drop commits without asking the user.
- When in doubt about conflict resolution — ask the user.
Workflow
1. Commit uncommitted changes in the current worktree
Check for uncommitted changes in the current worktree:
git status --porcelain
If there are uncommitted changes, use the /commit skill to commit them before continuing.
2. Merge the topic branch into the base branch
Use git -C <main-worktree-path> to run commands against the main worktree without leaving the current worktree.
git -C <main-worktree-path> merge <topic-branch>
3. Handle merge conflicts
If the merge reports conflicts:
3.1. List conflicted files:
git -C <main-worktree-path> diff --name-only --diff-filter=U
3.2. For each conflicted file, read the file content, resolve the conflict by preserving the intent of both sides, and stage the resolved file:
git -C <main-worktree-path> add <resolved-file>
3.3. When in doubt on how to resolve a merge conflict, ask the user for guidance. If the user wants to abort, run:
git -C <main-worktree-path> merge --abort
3.4. Once all conflicts are resolved and staged, commit the merge:
git -C <main-worktree-path> commit --no-edit
Validation
After the merge completes, verify the result:
- Confirm the main worktree is clean:
git -C <main-worktree-path> status --porcelain
- Confirm the topic branch is an ancestor of the base branch (i.e. all commits are merged):
git -C <main-worktree-path> merge-base --is-ancestor <topic-branch> HEAD
Frequently asked questions about Merge Changes
Similar skills
Release Candidate Preparation
Streamline your OpenAI Agents release process.
Gitmoji
Generate expressive commit messages with emojis.
GitHub Release
Automate your GitHub library release process effortlessly.
Commit Message Storyteller
Generate meaningful commit messages from your git diffs.
Author Contributions
Trace author contributions across branches in Git.
Implementation Kickoff
Streamline your code implementation process with ease.
