Skip to content

Instantly share code, notes, and snippets.

@leodutra
Last active July 31, 2025 19:29
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
@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