Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@leodutra
Last active November 1, 2023 05:01
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leodutra/a25bc1f51e8779943df0a95d5a4839d1 to your computer and use it in GitHub Desktop.
Save leodutra/a25bc1f51e8779943df0a95d5a4839d1 to your computer and use it in GitHub Desktop.
Enable long paths on Windows 10 and Git

If you run Windows 10 Home Edition you could change you Registry to enable Long Paths.

Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem in regedit and then set LongPathsEnabled to 1.

If you have Windows 10 Pro or Enterprise you could also use Local Group Policies.

Go to Computer Configuration > Administrative Templates > System > Filesystem in gpedit.msc, open Enable Win32 long paths and set it to Enabled.

git config --system core.longpaths true
@PratikDeshmukh-avisys
Copy link

Tested same on Windows 11 Pro 22H2 and it works. Thanks.

@VamsiUoB
Copy link

Hi,

I am trying to clone the repository from Bitbucket to the VS Code using Git cloning and I am getting failures (Red) on few folders particularly on Portal Folders. Thought it might be because of Long Paths so I have tried above suggestion but still it didn't work and I am using Windows 11 Pro. Could you able to suggest any resolutions for this issue? Thanks

@naikrovek
Copy link

the git client you're using must also turn long filenames on. try this:

git config --global core.longpaths true

@VamsiUoB
Copy link

Thank you so much for your quick response @naikrovek . I tried running that command yesterday but still no luck. I have tried running using Git CMD and also Git Bash. Can you able to provide some instruction steps how to turn long file names I will try just in case...Many thanks in advance.

@naikrovek
Copy link

@VamsiUoB
Copy link

@naikrovek , Thank you again...I am very new to all these so I am still learning. I will go through the link that you have provided and see if I can able to resolve my problem.

@krt16
Copy link

krt16 commented Sep 18, 2023

thank you so much mr. leo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment