git-worktree

Automate Git worktree creation, listing, switching, and cleanup.

Updated Dec 21, 2023
One-click install
npx skills add https://github.com/Hff1230/FFNotes --skill git-worktree-hff1230
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/Hff1230/FFNotes/tree/main/AI%E5%BA%93/Skill/compound-engineering-zh/skills/git-worktree
Command: npx skills add https://github.com/Hff1230/FFNotes --skill git-worktree-hff1230

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

此技能通过统一的交互式界面,简化并行开发中对 Git worktree 的创建、列出、切换与清理的管理,避免直接手动执行复杂命令。

Core Features & Use Cases

  • 创建工作树,分支清晰
  • 列出工作树及其状态
  • 在工作树之间切换
  • 自动清理已完成的工作树
  • .gitignore 管理
  • 从主仓库复制 .env 文件

Quick Start

创建一个名为 feature-name 的工作树,基于 main 分支,并切换到新工作树。

Frequently Asked Questions about git-worktree

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

FAQPage Schema
How do I manage Git worktrees for parallel development without running manual commands?

You can manage Git worktrees for parallel development through an interactive interface that automates creating, listing, switching, and cleaning worktrees. This avoids directly executing complex manual Git commands for multi-branch workflows.

How do I create a Git worktree and switch to it automatically?

To create a Git worktree, you use an interactive prompt to specify a name and base branch like main. The manager automatically creates the worktree, handles .gitignore entries, copies environment files, and switches your context.

Can I copy .env files from the main repository when creating a new Git worktree?

Yes, when creating a new Git worktree, the manager automatically copies environment files from the main repository. This ensures your parallel development branch has the necessary configuration without manual duplication.

What is the best way to clean up completed Git worktrees across feature branches?

The best way to clean up completed Git worktrees is using an automated manager that handles removal interactively. It tracks worktree statuses across feature branches and cleans them up to keep your repository organized.

Does interactive branch management handle .gitignore for multiple worktrees?

Yes, interactive branch management handles .gitignore configurations automatically. When you create new worktrees for parallel development, the manager ensures ignore rules are properly applied without manual editing.