Conversation
Drop the required main worktree model. Store bare repos under $XDG_DATA_HOME/git-wt/repos/<name>.git and create on-demand worktrees under $GIT_WT_WORKTREE_ROOT (default ~/worktrees). Add repo add/list/remove, --repo/--current (or interactive picker) on worktree commands, rewrite migrate to register bare + rehome all worktrees, remove off, and update the zsh wrapper accordingly. Migrate configures bare origin fetch tracking like repo add, and repository names are normalized by stripping a trailing .git suffix.
Move the lipgloss table border and cell styling used by worktree list into newOutputTable so other commands can reuse the same presentation.
Render git-wt repo list with the same bordered table style as git-wt list, using Name and Path columns.
Replace a leading $HOME prefix with ~ when rendering bare repository paths in git-wt repo list.
Have the zsh wrapper leave the worktree before remove runs and cd to $HOME afterward. Warn when remove deletes the current directory.
When cwd is inside a managed worktree, list/prune/remove resolve the registered repo automatically so --current is only needed on create.
When migrate registers a plain clone that only has a clean checkout of origin/HEAD, keep the bare repo only and drop the source tree instead of creating a managed default-branch worktree. Have the zsh wrapper cd to HOME after migrate as well as remove, so the shell does not stay in a path migrate may have deleted or moved.
Git porcelain paths on macOS often use /private/var while constructed paths use /var. Compare and walk paths via canonical form so managed worktree detection, empty-parent cleanup, and bare-repo checks agree.
Show repository name in git-wt list. Outside a managed worktree, or with --all, include every registered repository; inside a worktree, scope to that repository unless --all or --repo is given.
Register cobra flag completion for --repo on create/list/remove/prune. Fix the zsh completer to declare _arguments state variables, complete list --all, nested worktree names for switch/remove, and repo remove names.
nnutter
enabled auto-merge
August 9, 2026 21:43
git init --bare keeps HEAD on init.defaultBranch (often master on GitHub Actions) even after only main is pushed. Set HEAD to main so clones, migrate, and remote set-head --auto behave the same locally and in CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now stores bare repos under
$XDG_DATA_HOME(e.g.,~/.local/share/git-wt/repos) rather than even having a "main" worktree. Creates on-demand worktrees under$GIT_WT_WORKTREE_ROOT(default~/worktrees).