merge

Merge a Git worktree branch into its detected base branch with approval.

1|4|Updated Oct 27, 2014
One-click install
npx skills add https://github.com/rjernst/dotfiles --skill merge-rjernst
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge
Source: https://github.com/rjernst/dotfiles/tree/main/claude/skills/merge
Command: npx skills add https://github.com/rjernst/dotfiles --skill merge-rjernst

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you safely merge the current worktree’s branch back into its base branch with a reviewable, history-informed commit message.

Core Features & Use Cases

  • Worktree-aware safety checks: Detects whether you’re actually inside a Git worktree and stops early if you aren’t.
  • Automatic base-branch detection: Chooses the closest ancestor base branch using either upstream refs (if available) or main/master (if not).
  • Review-gated merge with crafted commit message: Drafts a commit message from commit history, requires explicit approval, then runs ta wt merge to perform the merge.

Quick Start

Run /merge from inside the worktree you want to merge, then approve the displayed merge review to execute the merge.

Frequently Asked Questions about merge

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

FAQPage Schema
How do I merge a git worktree branch back into its base branch?

To merge a git worktree branch, run the merge command from inside the worktree to automatically detect the base branch, draft a commit message from history, and execute the merge after explicit approval.

How does automatic base branch detection work for git worktrees?

Base branch detection for git worktrees works by choosing the closest ancestor using upstream refs if available, or falling back to main or master if upstream refs are not configured.

Can I use this merge workflow outside of a git worktree?

No, you cannot use this merge workflow outside a git worktree because the process includes safety checks that detect whether you are inside a worktree and stops early if you are not.

What happens if there are merge conflicts when merging a worktree branch?

When merge conflicts occur, the workflow handles the dirty state and conflict detection without attempting conflict resolution, stopping the process to let you resolve issues manually.

Do I need to write my own commit message for a worktree branch merge?

You do not need to write your own commit message because the workflow drafts a reviewable, history-informed commit message directly from the git log history before the review gate.