Skip to content
Back to skills

1617 Worktree Merge 4a9a1311

ASecurity

Merge changes from a worktree branch into current branch

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
toolsbashgit

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 1617-worktree-merge_4a9a1311 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 1617 Worktree Merge 4a9a1311?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 1617 Worktree Merge 4a9a1311
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-1617-worktree-merge-4a9a1311/badge)](https://www.skillsdirectory.com/skills/tools-only-1617-worktree-merge-4a9a1311)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
description: "Merge changes from a worktree branch into current branch"
argument-hint: Worktree branch name to merge (e.g., "feature/login")
allowed-tools: Bash, Read, Grep, TodoWrite, AskUserQuestion
---

# Git Worktree Merge

Merge changes from a worktree branch into the current branch.

## Phase 1: Analyze Current State

**Actions**:
1. `git branch --show-current` - get current branch
2. `git worktree list` - show all worktrees
3. `git status` - check for uncommitted changes

**If uncommitted changes**:
- Warn user
- Ask: stash, commit, or abort?

## Phase 2: Select Source Branch

**If `$ARGUMENTS` provided**:
- Use as source branch name
- Validate branch exists

**If empty**:
- List available worktree branches
- Ask user to select one

## Phase 3: Preview Changes

**Show merge preview**:
```bash
git log --oneline <current>..<source>
git diff --stat <current>..<source>
```

**Ask user**:
- Confirm merge?
- Merge strategy: merge commit or squash?

## Phase 4: Execute Merge

**Standard merge**:
```bash
git merge <source-branch> --no-ff -m "Merge branch '<source>' into <current>"
```

**Squash merge**:
```bash
git merge --squash <source-branch>
git commit -m "<generated-message>"
```

## Phase 5: Handle Conflicts

**If conflicts occur**:
1. List conflicting files
2. Ask user to resolve manually or abort
3. After resolution: `git add . && git commit`

## Phase 6: Post-Merge

**Ask user**:
- Delete source worktree? (use `/git:worktree-remove`)
- Push merged changes?
- Create PR?

**Show summary**:
- Commits merged
- Files changed
- Current branch status

## Merge Strategies

| Strategy | Use Case |
|----------|----------|
| merge --no-ff | Preserve full history |
| merge --squash | Clean single commit |
| rebase | Linear history (advanced) |

## Output Language

- All messages: Chinese
- Git commands: As-is

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…