All of lore.kernel.org
 help / color / mirror / Atom feed
* fatal: ... is already checked out at ...
@ 2019-04-03 22:15 Mark Kharitonov
  2019-04-04  8:30 ` Eric Sunshine
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Kharitonov @ 2019-04-03 22:15 UTC (permalink / raw)
  To: Git Mailing List

Hi,
Please, observe:

C:\Dayforce\56 [release/r-856 ≡]> git --version
git version 2.18.0.windows.1
C:\Dayforce\56 [release/r-856 ≡]> git worktree list
C:/Dayforce/tip    c80539e06d [arch/shelve/532684]
C:/Dayforce/55     1362776f49 [release/r-855]
C:/Dayforce/55WFM  0000000000 [wfm/855wfm]
C:/Dayforce/56     f9c36d3a2b [release/r-856]
C:/Dayforce/56     f9c36d3a2b [release/r-856]
C:/Dayforce/hf56   5f1837a3f6 [hotfix/856]

Item #1 - how come I have two instances of release/r-856 in the git
worktree list output?
Next:

C:\Dayforce\56 [release/r-856 ≡]> git co onboarding/r-856/james-config
Checking out files: 100% (2055/2055), done.
Switched to branch 'onboarding/r-856/james-config'
Your branch is up to date with 'origin/onboarding/r-856/james-config'.
C:\Dayforce\56 [onboarding/r-856/james-config ≡]> git co release/r-856
fatal: 'release/r-856' is already checked out at 'C:/Dayforce/56'

Item #2 - why cannot I checkout release/r-856, if I am already in the
right working tree? I suppose it is connected to item #1
Next:

C:\Dayforce\56 [onboarding/r-856/james-config ≡]> git co -B
release/r-856 $(git rev-parse release/r-856)
Checking out files: 100% (2055/2055), done.
Switched to and reset branch 'release/r-856'
Your branch is up to date with 'origin/release/r-856'.
C:\Dayforce\56 [release/r-856 ≡]>

This is how I forced the checkout.

Does not seem right. Is it a git bug or is it something we are doing wrong?
Thank you.

-- 
Be well and prosper.
==============================
"There are two kinds of people.Those whose guns are loaded and those who dig."
   ("The good, the bad and the ugly")
So let us drink for our guns always be loaded.

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

* Re: fatal: ... is already checked out at ...
  2019-04-03 22:15 fatal: ... is already checked out at Mark Kharitonov
@ 2019-04-04  8:30 ` Eric Sunshine
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Sunshine @ 2019-04-04  8:30 UTC (permalink / raw)
  To: Mark Kharitonov; +Cc: Git Mailing List

On Wed, Apr 3, 2019 at 6:15 PM Mark Kharitonov
<mark.kharitonov@gmail.com> wrote:
> C:\Dayforce\56 [release/r-856 ≡]> git --version
> git version 2.18.0.windows.1
> C:\Dayforce\56 [release/r-856 ≡]> git worktree list
> [...]
> C:/Dayforce/56     f9c36d3a2b [release/r-856]
> C:/Dayforce/56     f9c36d3a2b [release/r-856]
>
> Item #1 - how come I have two instances of release/r-856 in the git
> worktree list output?
>
> C:\Dayforce\56 [release/r-856 ≡]> git co onboarding/r-856/james-config
> Switched to branch 'onboarding/r-856/james-config'
> Your branch is up to date with 'origin/onboarding/r-856/james-config'.
> C:\Dayforce\56 [onboarding/r-856/james-config ≡]> git co release/r-856
> fatal: 'release/r-856' is already checked out at 'C:/Dayforce/56'
>
> Item #2 - why cannot I checkout release/r-856, if I am already in the
> right working tree? I suppose it is connected to item #1

You probably hit the bug reported in [1], which was fixed by [2] which
made it into Git 2.20.0. Specifically, prior to 2.20.0, you could get
invalid duplicate worktree entries like this:

    $ git worktree add foo bar
    $ rm -rf foo
    $ git worktree add foo bar
    $ git worktree list
    ...
    foo  deadbeef [bar]
    foo  deadbeef [bar]

If you don't have any changes in C:/Dayforce/56, an easy way to
recover from the situation is to blast the directory, prune the
worktree list, and re-create:

    $ rm -rf C:/Dayforce/56
    $ git worktree prune -v
    $ git worktree list # just to verify that duplicate entries are gone
    $ git worktree add C:/Dayforce/56 release/r-856

[1]: https://public-inbox.org/git/20180821193556.GA859@sigill.intra.peff.net/
[2]: https://public-inbox.org/git/20180828212026.21989-6-sunshine@sunshineco.com/

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

end of thread, other threads:[~2019-04-04  8:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 22:15 fatal: ... is already checked out at Mark Kharitonov
2019-04-04  8:30 ` Eric Sunshine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.