After updating to git for Windows 2.25.0 (64 bit), I am not able to work with mapped network drives that require authentication (see error message below). The network location I'm connecting to is a samba share that uses Active Directory for authentication. Note that network locations (on the same server) that _don't_ use authentication still work fine. This worked fine with 2.24.1.2 and all previous versions that I tried (and it works again after downgrading to 2.24.1.2).
$ git --version --build-options
git version 2.25.0.windows.1
cpu: x86_64
built from commit: 7c71c859c97853ed057da5cbab12f3c13b5554df
sizeof-long: 4
sizeof-size_t: 8
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.18363.592]
# 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
Editor Option: VIM
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled
Not that I know of.
Tested with all of the above (with identical result)
cd /<pathToMappedNetworkDrive>/
git init
Initialized empty Git repository in
fatal: unable to get current working directory: No such file or directory
Works/fails with any repository
PS: Thanks for the great project! I hope you will able to keep up the excellent work you are doing for a long time!
I have the same issue on my machine with the current version 2.25. I want to add, that it also happens with shares on a Windows Server 2016.
I noticed the same problem when executing git clone on a ramdisk (imdisk) with a slightly different error message: _fatal: unable to get current working directory: No such file or directory_. After reverting to 2.24.1 it works again.
I noticed the same problem when executing
git cloneon a ramdisk (imdisk) with a slightly different error message: _fatal: unable to get current working directory: No such file or directory_. After reverting to 2.24.1 it works again.
Double-checked on my side. In my case, it's really
fatal: Unable to **read** current working directory: No such file or directory
Hmm. This might be caused by 1e64d180a632aa6063f7dbdf019a44e95383867c, i.e. by GetFinalPathNameByHandleW() not handling the paths in this case.
If you get a chance to compile Git for Windows from source, you could revert 1e64d180a632aa6063f7dbdf019a44e95383867c and see whether that "fixes" the issue.
And if that "fixes" the issue, I would like you to test this patch instead of the revert:
diff --git a/compat/mingw.c b/compat/mingw.c
index f5de482c545..f6b38ee83bf 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1272,8 +1272,13 @@ char *mingw_getcwd(char *pointer, int len)
if (hnd != INVALID_HANDLE_VALUE) {
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
CloseHandle(hnd);
- if (!ret || ret >= ARRAY_SIZE(wpointer))
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
+ return NULL;
+ }
+ }
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
return NULL;
return pointer;
Looks like you're on the right track. Both fixes seem to work for me :)
@bmueller84 could you prepare a PR for this?
Thank you, @bmueller84!
@bmueller84 just to make sure, would you be able to test the latest snapshot?
I tested the snapshot on my network, everything is now functioning as expected.
Tested with Git-prerelease-2.25.0.windows.1.9.g387e7103e8-64-bit.exe - works like a charm :)
fwiw, i had the same problem while trying to clone a repo under a ram-disk drive, and this issue is now fixed as well, tested using build 2.25.0.windows.1.24.gfae73c7d25 - thank you!