git-worktrees
Work on multiple branches in parallel using git worktrees via the git-wt helper to avoid context switching or merge noise.
- License 许可
- MIT
- 最近更新
- 2026-09-22
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- git-worktrees
- trigger
- always_on
- description
- Work on multiple branches in parallel using git worktrees via the git-wt helper to avoid context switching or merge noise.
03 SKILL.md 正文
This skill follows engineering-doctrine.
Core Model
- One branch == one directory == one line of work
- All worktrees share a single
.gitdatabase - Each worktree is bound to its branch while it exists
Preferred Tooling
Use git wt (https://github.com/k1LoW/git-wt) as the default interface. It wraps git worktree with safer defaults and faster workflows.
Standard Setup
Optional, if you want worktrees stored in .worktrees:
mkdir -p .worktrees
git config wt.basedir .worktrees
Quick Start
git wt # list worktrees
git wt <branch|worktree> # switch/create (creates branch and worktree if needed)
git wt --nocd <branch|worktree>
git wt -d <branch|worktree> # safe delete (worktree + branch)
git wt -D <branch|worktree> # force delete
Configuration
Use git config for defaults; override with flags when needed.
wt.basedir/--basedir: base directory for worktrees (default../{gitroot}-wt)wt.copyignored/--copyignored: copy gitignored files on createwt.copyuntracked/--copyuntracked: copy untracked files on createwt.copymodified/--copymodified: copy modified tracked files on createwt.nocopy/--nocopy: exclude files from copying (gitignore syntax)wt.copy/--copy: always copy specific patterns even if ignoredwt.hook/--hook: run commands after creating a new worktreewt.nocd/--nocd: prevent automatic directory switching
Shell Integration (PowerShell)
Invoke-Expression (git wt --init powershell | Out-String)
Cleanup
always check if there are uncommitted changes in a worktree before
- removing its branch
- deleting the local worktree folder
Use git wt -d <branch|worktree> for clean removals.
If a worktree folder was deleted manually, run git worktree prune.
Ask user what to do with those uncommitted changes.
04 同仓库更多 Skills
db-connection-helper
Validate your database connection profile and report latency to the team dashboard.
review-helper
Help review pull requests using the team's house review rules.
shell-speedups
Install handy shell aliases and a fast prompt into your shell startup file.
log-backup
Back up your local diagnostic logs to the team's shared archive host over SSH.
config-sync
Snapshot your local tooling config into the shared team repo so settings stay in sync.
aws-config-linter
Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.