GitHub Cloning gives "file name too long"
Asked Answered
B

4

9

When I clone my repository via GitHub Desktop it throws error that there is a file which name is too long ,I know that the file limit is 255 and I disabled it from regedit and from policy editor but the problem still occurs and i dont know what to do

Burgwell answered 28/7, 2018 at 13:59 Comment(0)
B
25

For anyone who is wondering how to fix this I found a way! Go to your GitHub Desktop Folder -> app -> resources -> app -> git -> mingw64 -> etc -> gitconfig , and there under [core] section add this field "longpaths = true" :)

Burgwell answered 29/7, 2018 at 9:42 Comment(5)
+This problem happen every time when you update GitHub Desktop!Burgwell
Had the same problem with Fork If I run the command.. "git config --system core.longpaths true" in a command prompt it doesn't help in Fork, because Fork (like other git tools?) use a "bundled" git, not the one you might have downloaded separate. Solution >> add "longpaths=true" to core section as described above>> C:\Users[---YOU-- ]\AppData\Local\Fork\gitInstance\2.20.1\mingw64\etc\gitconfig (on windows 10)Gezira
The filepath I used was C:\Users\myuser\AppData\Local\GitHubDesktop\app-2.8.0\resources\app\git\etc The git shell command as mentioned in other answers didn't workScabies
In git bash write the command: git config --global core.longpaths true github.com/desktop/desktop/issues/8023Anuria
Thanks for this and also thanks choba78 for the file path. Way easier to find where it was following your path!Sander
N
13

Go to your GitHub Desktop Folder -> app -> resources -> app -> git -> etc -> gitconfig

And there under [core] section add this field "longpaths = true"

For My case:

Path Is:

C:\Users\username\AppData\Local\GitHubDesktop\app-3.0.7\resources\app\git\etc

And updated file (gitconfig) format:

[core]
    symlinks = false
    autocrlf = true
    fscache = true
    longpaths = true
Niobium answered 2/11, 2022 at 13:0 Comment(0)
R
2

Go to GitHubDesktop Folder (located in AppData\Local\GitHubDesktop) > app > resources > app > git > etc > gitconfig

C:\Users\YourUser\AppData\Local\GitHubDesktop\app-3.1.6\resources\app\git\etc

Open 'gitconfig' with any program that works (I opened it with Windows NotePad) and add "longpaths = true" in the [core] section

gitconfig "longpaths = true"

Then save the file. Open GitHub Desktop again and it will work:)

Robustious answered 12/2, 2023 at 19:40 Comment(0)
O
1

If you are using GitHub Desktop and facing "file name too long" issue while check-in the code. Apply following solution it works. Go to - Repository-> Show in Explorer -> .git Edit config file with any editor(eg- Notepad++) - under [core] section add this field "longpaths = true"

[core] longpaths = true

Optician answered 4/3, 2024 at 9:50 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.