Skip to content

Instantly share code, notes, and snippets.

@leodutra
Last active June 24, 2025 03:20
Show Gist options
  • 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 11 or Windows 10 and Git

Enable Long Paths on Windows

Instructions for Windows 11 and Windows 10

Windows 11

Method 1: Registry Editor (Most Reliable)

  1. Press Win + R, type regedit, and press Enter
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  3. Find LongPathsEnabled (create it if missing as DWORD)
  4. Set value to 1
  5. Restart your computer

Method 2: PowerShell (Administrative) Run PowerShell as Administrator:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Method 3: Group Policy (Pro/Enterprise)

  1. Press Win + R, type gpedit.msc, and press Enter
  2. Navigate to: Computer Configuration > Administrative Templates > System > Filesystem
  3. Open Enable Win32 long paths
  4. Set to Enabled

Note: Developer Mode in Windows 11 Settings does not enable long paths - this is a common misconception.

Windows 10

Windows 10 Home: Use the Registry method above

Windows 10 Pro/Enterprise: Use either Registry or Group Policy method

Configure Git

After enabling system-wide long paths, configure Git:

System-wide (affects all users):

git config --system core.longpaths true

Per user (optional):

git config --global core.longpaths true

Per repository (current repo only):

git config core.longpaths true

Important Notes

  • Restart required: Changes take effect after reboot
  • Application support: File Explorer still doesn't fully support long paths - mainly benefits command-line tools and compatible applications
  • Path limit: Maximum supported path length is approximately 32,767 characters
  • Compatibility: Some older applications may still have issues with long paths
@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

@KenOcheltree
Copy link

Thanks!

@MC-XiaoHei
Copy link

thanks so much!

@leodutra
Copy link
Author

Enhanced with updated data.

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