Skip to content

First call git checkout does not work in Windows Docker container in mounted host volume folder #2778

@mariuszkochanowski

Description

@mariuszkochanowski

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.28.0.windows.1
cpu: x86_64
built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19041.388]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** insert your machine's response here **
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Running Git for Windows in a Windows Container directly on a volume mount point.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** insert your response here **

After 'git clone' first direct call of 'git checkout mybranchname' always ends witch error:
cannot lock ref 'refs/heads/mybranchname': unable to resolve reference 'refs/heads/mybranchname': Not a directory

Second call works properly.

It occours in  in mcr.microsoft.com/windows/servercore:2004 in mounted host volume folder.
It not occours in not mounted volume folder and directry in host machine

  • What did you expect to occur after running these commands?

** insert here **

  • What actually happened instead?

** insert here **

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

** insert URL here **

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions