-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Cloning with long paths fails even when core.longPaths is set to true #2075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is probably fixed by 4f2dbdd. could you test if 2.21.0-rc1 solves this issue? |
@rimrul: Oh, that indeed sounds like it could solve my issue 🙂. Thanks for pointing this out! So I’ll try out Git for Windows 2.21.0-rc1, and I’ll let you know whether or not this fixes my issue. |
That'd be great, thanks. |
That commit has been in Git for Windows for quite a while now... My guess is that it is a problem where we still do not quite have long paths support when trying to do anything. @pluehne do you think you can transmogrify your scenario(s) into a PR that adds a regression test to, say, |
@dscho: Thanks for your reply. Sure, I will try to write a regression test as you suggested 🙂. I’m a bit busy right now, so might need a week or so to do that. I’ll still try the newest release candidate in the meantime to see whether some other change fixed the issue for me. |
Looks like the issue persists with 2.20.1-rc.1. I’ll come back to you when I have had the time to write the regression test. Thanks for your help so far! |
I'll stop holding my breath for that regression test ;-) |
@dscho Hi, is this issue fixed by git version 2.26.0? |
It's supposed to. Can't you check? |
I am facing the exact same issue with git clone -c core.longpaths=true repo-url |
@rishabhBudhouliya maybe you can? |
@dscho Sure! I'll write a regression test. Thanks for your response. |
I have run into this issue as well while trying to use terragrunt (terraform wrapper). I think the issue stems from the fact that it is the local destination directory that is too long. I was able to clone the same repo into a shorter base directory, but unable to do so (getting the same error as at the start of this ticket). Using git 2.26.2.windows.1. |
Yes, and it might be impossible without major work on Git and setting a registry flag (and rebooting). |
Setup
defaults?
Any other interesting things about your environment that might be related
to the issue you're seeing?
Nothing that I know about.
Details
Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
I could reproduce this with both Bash and
cmd.exe
.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.
Experiment 1
C:\Users\username\Desktop\longpath\longpathlongpathlongpath\longpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpath\longpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlo
cmd.exe
and change into this directoryExperiment 2
C:\Users\username\Desktop\longpath\longpathlongpathlongpath\longpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpath\longpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlongpathlo
cmd.exe
and change into this directoryComputer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled
was set to 1 initially. We tried to set it to 0, but this didn’t change the outcome in any of the experiments.What did you expect to occur after running these commands?
My expectation would be to get a fresh clone without any errors in all of the experiments listed above.
What actually happened instead?
Experiment 1 (Git Bash)
Experiment 1 (
cmd.exe
)Experiment 2 (Git Bash)
Experiment 2 (
cmd.exe
)If the problem was occurring with a specific repository, can you provide the
URL to that repository to help us with testing?
I don’t believe this is related to repositories with specific contents, but I tested this with https://github.com/Autodesk/hubble.git and https://github.com/github/github-graphql-rails-example.
Further Comments
I’ve read the release notes, and I understand that
core.longPaths
needs to be set totrue
in order for long paths to be supported by Git. Still, cloning fails regardless of whether this option is set (both throughgit config
or by invoking Git withgit -c core.longPaths=true ...
).I’ve seen issue #1710, which is about support for long paths in
git init
andgit push
. As the present issue affectsgit clone
operations, I thought it best to open a new issue for this. I hope this was the right thing to do from your perspective.Searching through the preexisting issues in this repository, it appears that setting
core.longPaths
totrue
solved the problem for many other users in the past. I’m not sure why this doesn’t appear to work in my case, and I’d appreciate any help in debugging this.The text was updated successfully, but these errors were encountered: