一键导入
git-wt
Guide for using git-wt to manage isolated git worktrees. Use this for all code modification tasks to ensure a clean, safe, and disposable environment.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for using git-wt to manage isolated git worktrees. Use this for all code modification tasks to ensure a clean, safe, and disposable environment.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | git-wt |
| description | Guide for using git-wt to manage isolated git worktrees. Use this for all code modification tasks to ensure a clean, safe, and disposable environment. |
git-wt is a wrapper around git worktree that simplifies creating isolated workspaces.
ALWAYS use git-wt for creating new features, fixing bugs, or experimenting.
Run this command to start a task. Always use --copyignored to ensure .env and local configs are copied.
git wt <new-branch-name> --copyignored
CRITICAL: The command will output the absolute path to the new worktree (e.g., /path/to/project-wt/new-branch-name).
You MUST use this path as the workdir for all subsequent bash commands and as the base for file operations (read, edit, write). Do not continue working in the original directory.
Perform all your edits, tests, and commits inside the new directory.
Push your branch to the remote.
# inside the worktree
git push -u origin <new-branch-name>
(Or use gh pr create if instructed).
Once the code is pushed or the PR is created, delete the local worktree to save space.
# Run this from the ORIGINAL directory, or any other directory (not inside the one being deleted)
git wt -d <new-branch-name>
| Goal | Command |
|---|---|
| List Worktrees | git wt |
| Start Task | git wt <branch> --copyignored |
| Start from Base | git wt <branch> origin/main --copyignored |
| Delete (Safe) | git wt -d <branch> (Prevents deleting unmerged work) |
| Delete (Force) | git wt -D <branch> (Use if you want to discard changes) |