Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
completion issue for "git worktree add"
- X-seq: zsh-workers 54210
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: completion issue for "git worktree add"
- Date: Mon, 2 Mar 2026 17:38:28 +0100
- Archived-at: <https://zsh.org/workers/54210>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
Consider a git working tree where there is some remote branch
"hermite", but no such local branch yet:
qaa% git branch -a | grep hermite
remotes/origin/hermite
On "git checkout he", [Tab] completes it to "git checkout hermite"
as expected, but not on "git worktree add ../mpfr-hermite he". The
intent is the following from the git-worktree(1) man page:
If <commit-ish> is a branch name (call it <branch>) and is not
found, and neither -b nor -B nor --detach are used, but there does
exist a tracking branch in exactly one remote (call it <remote>)
with a matching name, treat as equivalent to:
$ git worktree add --track -b <branch> <path> <remote>/<branch>
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author