From tp-git
Attach metadata to commits without rewriting history and work on multiple branches simultaneously with worktrees.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tp-git:git-advancedWhen to use
Use when the user says 'git notes', 'add note to commit', 'annotate commit', 'attach metadata', or 'worktree'. IMMEDIATELY when the user asks to 'work on multiple branches', 'switch branches without stashing', 'checkout multiple branches', 'parallel branches', or 'branch in parallel'. BEFORE stashing changes to switch contexts — offer worktree as an alternative.
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
IF annotating a commit post-hoc → use `git notes add`
IF annotating a commit post-hoc → use git notes add
IF accumulating metadata over time → use git notes append (not add -f)
IF notes must be shared with the team → push the notes ref explicitly
IF notes disappear after rebase → configure notes.rewrite.rebase true
IF working on multiple branches simultaneously → use worktrees instead of stashing
IF reviewing a PR while actively developing → create a temporary review worktree
IF running long-running tests → use a detached worktree to keep the main tree clean
IF comparing implementations across branches → create worktrees and diff directly
Power-user git utilities: attach metadata to commits without changing their SHA, and check out multiple branches simultaneously in separate directories. These are independent workflows that share no state — route by keyword.
Attach metadata to git commits without changing their SHA. Notes live in separate refs (refs/notes/commits by default) and display alongside commit messages in git log and git show.
Add information to commits after creation without rewriting history. Non-invasive, shareable, namespaceable.
| Task | Command |
|---|---|
| Add note | git notes add -m "message" <sha> |
| View note | git notes show <sha> |
| Append | git notes append -m "message" <sha> |
| Remove | git notes remove <sha> |
| Namespace | git notes --ref=<name> add -m "..." <sha> |
| Show in log | git log --notes=<name> |
| Push notes | git push origin refs/notes/<name> |
| Fetch notes | git fetch origin refs/notes/<name>:refs/notes/<name> |
| Preserve on rebase | git config notes.rewrite.rebase true |
git notes --ref=reviews add -m "Reviewed-by: Alice <[email protected]>" abc1234
git notes --ref=reviews append -m "Approved with minor suggestions" abc1234
git log --notes=reviews --oneline
git notes --ref=testing add -m "Tests passed: 2024-01-15 | Coverage: 85%" abc1234
git log --notes=testing --oneline
git notes --ref=audit add -m "Security review: PASSED | Ticket: SEC-456" abc1234
git push origin refs/notes/reviews
git fetch origin refs/notes/reviews:refs/notes/reviews
| Mistake | Fix |
|---|---|
| Notes not showing in log | Use git log --notes=<name> or configure notes.displayRef |
| Notes lost after rebase | Run git config notes.rewrite.rebase true before rebasing |
| Notes not on remote | Push explicitly: git push origin refs/notes/commits |
| "Note already exists" | Use append instead of add, or add -f to overwrite |
.git/refs/notes/ — viewable via git log --notes and git showNamespaces organize notes by purpose (reviews vs testing vs audit) and let you selectively share only what is needed.
Check out multiple branches simultaneously in separate directories, sharing one Git object database. Switch contexts by changing directories, not branches.
One worktree per active branch. Never stash, never clone again.
| Task | Command |
|---|---|
| Create (new branch from HEAD) | git worktree add -b <branch> <path> |
| Create (existing branch) | git worktree add <path> <branch> |
| Create (from remote) | git worktree add --track -b <branch> <path> origin/<branch> |
| Create (detached) | git worktree add --detach <path> <commit> |
| List all | git worktree list |
| Remove | git worktree remove <path> |
| Force remove | git worktree remove --force <path> |
| Move | git worktree move <old> <new> |
| Prune stale metadata | git worktree prune |
| Repair after manual move | git worktree repair |
| Lock | git worktree lock <path> |
../project-featureproject-hotfix, project-reviewgit worktree add -b hotfix-456 ../project-hotfix origin/main
cd ../project-hotfix # fix, commit, push
cd ../project
git worktree remove ../project-hotfix
git fetch origin pull/123/head:pr-123
git worktree add ../project-review pr-123
cd ../project-review # review, run tests
cd ../project
git worktree remove ../project-review && git branch -d pr-123
git worktree add --detach ../project-test HEAD
cd ../project-test && npm test &
cd ../project # continue working in parallel
git worktree add ../project-v1 v1.0.0
git worktree add ../project-v2 v2.0.0
diff -rq ../project-v1/src ../project-v2/src
# From any worktree, cherry-pick files across branches
git checkout feature-branch -- path/to/file.js
git checkout -p feature-branch -- path/to/file.js # interactive hunk selection
| Mistake | Fix |
|---|---|
rm -rf to delete a worktree | Always use git worktree remove, then prune if needed |
| "Branch is already checked out" | Run git worktree list to find which worktree has it |
| Stale metadata after manual deletion | Run git worktree prune |
| Moved worktree directory manually | Use git worktree move or run git worktree repair |
Worktrees share the Git object database — zero disk duplication, instant creation, no need to push/pull between working copies.
Keeps the main project tree clean. Worktrees are independent working copies, not subdirectories.
Enables parallel development workflows: feature work, hotfixes, PR reviews, and experiments can coexist without context-switching overhead.
npx claudepluginhub git-fg/taches-principled --plugin tp-gitGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.