git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug: "git worktree add" Unable to checkout a branch with no local ref

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 28, 2017, 09:15 UTC
Message-ID
<CACsJy8DQTi5s2BmHSkTTjVKZu+ToeVhywkZa2hzGtkzWo95LJw@mail.gmail.com>
In-Reply-To
<0E511C089BC341FBA9DC694C1CE770AE@daddy>

On Mon, Feb 27, 2017 at 9:22 PM, Alexander Grigoriev <alegrigoriev@gmail.com> wrote:

Show 6 quoted lines
> git version 2.10.2.windows.1:
> If a remote branch has never been checked out locally (its ref only exists
> in remotes/<remote>/ directory), "git worktree add" command is unable to
> check it out by its normal short name (not prefixed by remotes/<remote>),
> while "git checkout" command has been able to handle such a branch and
> properly convert it to a local branch.

We call that "dwim" (do what I mean). Unfortunately "git worktree add" does not support it.

In the early prototype, "git worktree" called "git checkout" underneath and something like that should have worked. But I don't remember if the dwim came up when we decided not to let "git worktree" run "git checkout". And since dwim thing is checkout thing, the feature is gone from "git worktree add".

Anyway, I think patches are welcome.
-- 
Duy
Previous: Alexander Grigoriev
Message 2 of 2 in “Bug: "git worktree add" Unable to checkout a branch with no local ref”
  1. Alexander GrigorievFeb 27, 2017
  2. Duy NguyenFeb 28, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.