Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

feat: add wt-update, wt-destroy tasks and fetch-before-add - #11

Merged
davidpoblador merged 1 commit into
mainfrom
feat/worktree-improvements
Feb 6, 2026
Merged

feat: add wt-update, wt-destroy tasks and fetch-before-add#11
davidpoblador merged 1 commit into
mainfrom
feat/worktree-improvements

Conversation

@davidpoblador

Copy link
Copy Markdown
Member

Summary

  • wt-add now fetches all remotes before branching, so new worktrees always start from fresh remote state. Skips gracefully when no remotes are configured.
  • wt-update (new task): fetches all remotes and fast-forwards the main worktree via --ff-only.
  • wt-destroy (new task): removes worktree, deletes local branch, and deletes the remote branch in one shot. Refuses to touch main.
  • Updated README and AGENTS.md with the new tasks, linked the followup post git-wt: Worktrees Simplified, and expanded credits for Ahmed el Gabri.

Inspired by git-wt.

Test plan

  • Scaffold a new project with a remote URL, verify wt-add fetches before creating the worktree
  • Scaffold a new project without a remote URL, verify wt-add skips fetch without errors
  • Run wt-update with a remote configured, verify main fast-forwards
  • Run wt-update without remotes, verify clean error message
  • Run wt-destroy on a branch with a remote counterpart, verify all three (worktree, local, remote) are removed
  • Run wt-destroy on a local-only branch, verify worktree and local branch removed with appropriate message
  • Run wt-destroy main, verify it refuses

🤖 Generated with Claude Code

- wt-add now fetches all remotes before branching (skips gracefully
  when no remotes are configured)
- wt-update fetches all remotes and fast-forwards main
- wt-destroy removes worktree, local branch, and remote branch
- Updated README and AGENTS.md with new tasks, linked the followup
  post "git-wt: Worktrees Simplified", and expanded credits for
  Ahmed el Gabri

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@davidpoblador
davidpoblador merged commit 0be8088 into main Feb 6, 2026
1 check passed
@davidpoblador
davidpoblador deleted the feat/worktree-improvements branch February 6, 2026 13:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant