- Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Setup
- Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options git version 2.25.1.windows.1 cpu: x86_64 built from commit: cceb69da75b4906bb04cfb3a2f7f37b12b985ec3 sizeof-long: 4 sizeof-size_t: 8 - 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.19013.1122] - What options did you set as part of the installation? Or did you choose the
defaults?
> type "C:\PRGM\Git\etc\install-options.txt" Editor Option: Notepad++ Custom Editor Path: Path Option: Cmd SSH Option: OpenSSH Tortoise Option: false CURL Option: OpenSSL CRLF Option: LFOnly Bash Terminal Option: ConHost Performance Tweaks FSCache: Enabled Use Credential Manager: Enabled Enable Symlinks: Enabled - Any other interesting things about your environment that might be related
to the issue you're seeing?
I am working on a german system.
I have installed git in the directory C:\PRGM\Git.
I think I am using a windows insider build.
Details
- Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
cmd
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
At first, I created a directory parent with a subdirectory child inside C:.
Then, I restricted accessing this directory to administrators.
After that, I gave the main user full control over the child subdirectory.
Then, I tried to clone a repository in the child directory as the main user:
C:\>cd parent Zugriff verweigert C:\>cd parent\child C:\parent\child>git clone https://github.com/octocat/Hello-World.git Cloning into 'Hello-World'... remote: Enumerating objects: 13, done. remote: Total 13 (delta 0), reused 0 (delta 0), pack-reused 13 Unpacking objects: 100% (13/13), 1.53 KiB | 8.00 KiB/s, done. error: Unable to create 'C:/parent/child/Hello-World/.git/refs/remotes/origin/HEAD.lock': No such file or directory fatal: unable to update refs/remotes/origin/HEAD - What did you expect to occur after running these commands?
I expected that a new directory Hello-World would be created containing a hidden .git directory and a file README.md would be created inside the child directory.
- What actually happened instead?
The cloning of the repository with the message error: Unable to create 'C:/parent/child/Hello-World/.git/refs/remotes/origin/HEAD.lock': No such file or directory (as seen in the commands section below).
The directory Hello-World was not created.
- If the problem was occurring with a specific repository, can you provide the
URL to that repository to help us with testing?
I tested it with the repository https://github.com/octocat/Hello-World but it seems to be the same with other repositories.
Notes
Zugriff verweigert means Access denied (when I try to access C:\parent (which is correct)) and Vollzugriff means Full-control
It works if I use the standard/linux version of git in WSL(in the same directory):
C:\parent\child>wsl -- bash --norc bash-5.0$ ls -la ls: ..: Permission denied total 0 drwxrwxrwx 1 dan dan 4096 Mar 1 13:45 . d--x--x--x 1 dan dan 4096 Mar 1 13:19 .. bash-5.0$ git clone https://github.com/octocat/Hello-World Cloning into 'Hello-World'... remote: Enumerating objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 3 Unpacking objects: 100% (3/3), done. bash-5.0$ ls -la ls: ..: Permission denied total 0 drwxrwxrwx 1 dan dan 4096 Mar 1 13:56 . d--x--x--x 1 dan dan 4096 Mar 1 13:19 .. drwxrwxrwx 1 dan dan 4096 Mar 1 13:56 Hello-World bash-5.0$ pwd /mnt/c/parent/child bash-5.0$pwd /mnt/c/parent/child bash-5.0$ ls -la Hello-World/ total 0 drwxrwxrwx 1 dan dan 4096 Mar 1 13:56 . drwxrwxrwx 1 dan dan 4096 Mar 1 13:56 .. drwxrwxrwx 1 dan dan 4096 Mar 1 13:56 .git -rwxrwxrwx 1 dan dan 56 Mar 1 13:56 README.md bash-5.0$ The same error occurs if I do it with git bash.

