-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Originally asked this as StackOverflow question, but was told it might be a Git for Windows bug.
Related to the advice observed in #2438 (comment).
Setup
-
Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options git version 2.33.0.windows.2 cpu: x86_64 built from commit: 8735530946cced809cc6cc4c2ca3b078cdb3dfc8 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon -
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.19043.1165] -
What options did you set as part of the installation? Or did you choose the
defaults?$ cat /etc/install-options.txt Editor Option: Notepad++ Custom Editor Path: Default Branch Option: main Path Option: Cmd SSH Option: OpenSSH Tortoise Option: false CURL Option: OpenSSL CRLF Option: CRLFAlways Bash Terminal Option: MinTTY Git Pull Behavior Option: Merge Use Credential Manager: Core Performance Tweaks FSCache: Enabled Enable Symlinks: Disabled Enable Pseudo Console Support: Disabled Enable FSMonitor: Disabled -
Any other interesting things about your environment that might be related
to the issue you're seeing?- Long Windows file paths have not been enabled explicitly.
git config core.longpathsis not set (neither for system nor globally).
Details
-
Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
PowerShell, Git Bash
-
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.git clone https://github.com/dependabot/dependabot-core --depth=1 file-name-test
ℹ️ Cloning fails due to "Filename too long"; Git suggests to rungit restore --source=HEAD :/cd file-name-testgit config core.longpaths true- Run command suggested by Git:
git restore --source=HEAD :/ git status
❌ Changes are reported; runninggit restorehad no effect
-
What did you expect to occur after running these commands?
Either:
- After running
git restore --source=HEAD :/no changes should be reported anymore - OR Git should not suggest running
git restore --source=HEAD :/if it would have no effect
- After running
-
What actually happened instead?
Git suggested to run
git restore --source=HEAD :/; it had no effect.Note that checkout succeeds when running
git restore --source=HEAD -SW :/orgit reset --hard. -
If the problem was occurring with a specific repository, can you provide the
URL to that repository to help us with testing?any repository with long file paths