git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Bug: "git worktree add" Unable to checkout a branch with no local ref
@ 2017-02-27 14:22 Alexander Grigoriev
  2017-02-28  9:15 ` Duy Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Grigoriev @ 2017-02-27 14:22 UTC (permalink / raw)
  To: git

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. 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: "git worktree add" Unable to checkout a branch with no local ref
  2017-02-27 14:22 Bug: "git worktree add" Unable to checkout a branch with no local ref Alexander Grigoriev
@ 2017-02-28  9:15 ` Duy Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Duy Nguyen @ 2017-02-28  9:15 UTC (permalink / raw)
  To: Alexander Grigoriev; +Cc: Git Mailing List

On Mon, Feb 27, 2017 at 9:22 PM, Alexander Grigoriev
<alegrigoriev@gmail.com> wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-28  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27 14:22 Bug: "git worktree add" Unable to checkout a branch with no local ref Alexander Grigoriev
2017-02-28  9:15 ` Duy Nguyen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).