This warning occurs when Git tries to create a symbolic link on Windows but lacks the required permissions. By default, Windows restricts symlink creation to administrators. The fix involves either enabling Developer Mode, running Git with elevated privileges, or configuring Git to handle symlinks differently.
The "unable to create symbolic link: Permission denied" warning indicates that Git is attempting to check out a repository containing symbolic links (symlinks), but Windows is blocking their creation due to security restrictions. On Unix-like systems (Linux, macOS), symbolic links are a common filesystem feature that any user can create. However, Windows historically restricted symlink creation to administrators as a security measure, because symlinks can be used in certain privilege escalation attacks. This warning typically appears when: - **Cloning a repository** that contains symbolic links created on Linux or macOS - **Checking out a branch** that introduces new symlinks - **Pulling changes** that add symlinks to the repository - **Running Git on Windows without proper permissions** or configuration When Git cannot create a symlink, it falls back to creating a regular file containing the target path. This may cause issues if your project relies on symlinks for shared configurations, build systems, or directory structures.
Windows 10 version 1703 and later allows unprivileged symlink creation when Developer Mode is enabled. This is the simplest and most persistent solution.
Steps to enable Developer Mode:
1. Open Settings (Windows key + I)
2. Navigate to Update & Security (Windows 10) or Privacy & Security (Windows 11)
3. Click For developers
4. Toggle Developer Mode to On
5. Confirm the prompt if asked
Using PowerShell (requires Admin):
# Enable Developer Mode via registry
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"After enabling Developer Mode, restart your terminal and try cloning or checking out again.
Verify it's enabled:
# Check Developer Mode status
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /v AllowDevelopmentWithoutDevLicenseIf the value is 0x1, Developer Mode is enabled.
Git on Windows may have symlink support disabled by default. You need to ensure it's enabled in your Git configuration.
Check current symlink setting:
git config --global core.symlinksIf it returns false or nothing, enable it:
Enable symlinks globally:
git config --global core.symlinks trueEnable symlinks for a specific repository:
cd /path/to/repo
git config core.symlinks trueImportant: Changing this setting doesn't automatically fix existing files. You'll need to re-checkout the affected files:
# Re-checkout all files to apply symlink setting
git checkout -- .
# Or for a clean start
git reset --hard HEADVerify symlinks were created:
# List files and their types (symlinks show with 'l' prefix)
ls -la
# Or check a specific file
file path/to/suspected/symlinkIf you installed Git for Windows without symlink support, you may need to reinstall it with the correct option enabled.
During Git installation:
1. Download Git for Windows from https://git-scm.com/download/win
2. Run the installer
3. When you reach the Configuring extra options screen, check the box:
"Enable symbolic links"
4. Complete the installation
Using winget:
# Uninstall existing Git
winget uninstall Git.Git
# Reinstall (you'll still need to check the symlinks option in the installer)
winget install Git.GitUsing Chocolatey:
# Install with symlink support
choco install git --params "/GitAndUnixToolsOnPath /NoShellIntegration /SChannel /WindowsTerminal /Symlinks"After reinstalling, restart your terminal and run:
git config --global core.symlinksThis should now return true.
If you can't enable Developer Mode (e.g., on a managed corporate machine), you can run Git with elevated privileges to create symlinks.
Running Git Bash as Administrator:
1. Right-click on Git Bash in the Start menu
2. Select Run as administrator
3. Click Yes on the UAC prompt
4. Navigate to your repository and clone/checkout
Running Command Prompt as Administrator:
1. Press Windows key + X
2. Select Terminal (Admin) or Command Prompt (Admin)
3. Run your Git commands from there
Running VS Code as Administrator:
1. Right-click on VS Code
2. Select Run as administrator
3. Open your repository folder
Note: Running as Administrator is not a good long-term solution because:
- It's inconvenient for daily work
- It poses security risks
- Some tools may behave unexpectedly with elevated privileges
Use this as a temporary workaround while you implement a permanent solution like Developer Mode.
On Windows Pro, Enterprise, or Server editions, you can grant your user account the right to create symbolic links without Administrator privileges.
Using Local Security Policy (secpol.msc):
1. Press Windows key + R, type secpol.msc, and press Enter
2. Navigate to: Local Policies > User Rights Assignment
3. Double-click Create symbolic links
4. Click Add User or Group
5. Add your username or a group you belong to
6. Click OK and close the windows
7. Log out and log back in for changes to take effect
Using PowerShell (requires Admin):
# Add current user to SeCreateSymbolicLinkPrivilege
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object System.Security.Principal.WindowsPrincipal($identity)
$user = $identity.Name
# This requires the Carbon PowerShell module
Install-Module Carbon -Force
Import-Module Carbon
Grant-CPrivilege -Identity $user -Privilege SeCreateSymbolicLinkPrivilegeUsing ntrights.exe (from Windows Resource Kit):
ntrights +r SeCreateSymbolicLinkPrivilege -u YourUsernameNote: On Windows Home edition, secpol.msc is not available. Use Developer Mode instead.
If you fixed the permissions after an initial clone, the repository already contains regular files instead of symlinks. You need to re-clone or reset to get proper symlinks.
Option 1: Re-clone the repository
# Move or delete the old clone
mv repo repo-old
# or: rm -rf repo
# Clone fresh with symlinks enabled
git clone https://github.com/user/repo.gitOption 2: Reset existing repository
cd repo
# Ensure symlinks are enabled
git config core.symlinks true
# Remove all tracked files and re-checkout
git checkout -- .
# If that doesn't work, do a hard reset
git reset --hard HEADOption 3: Remove and restore specific symlinks
# Remove the fake symlink file
rm path/to/symlink
# Restore it from Git
git checkout -- path/to/symlink
# Verify it's now a real symlink
ls -la path/to/symlinkVerify symlinks are working:
# On Windows Git Bash, symlinks show as 'lrwxrwxrwx'
ls -la
# Check symlink target
readlink path/to/symlinkIf you cannot enable symlink support and only need to link directories, NTFS junctions are an alternative that doesn't require special permissions.
Note: This is a workaround, not a Git-native solution. Junctions only work for directories, not files.
Creating a junction manually:
mklink /J "link-name" "target-directory"PowerShell:
New-Item -ItemType Junction -Path "link-name" -Target "target-directory"Limitations of junctions:
- Only work for directories, not files
- Must point to absolute paths (relative paths converted at creation)
- Only work on NTFS filesystems
- Git doesn't natively understand junctions
For projects you control:
If you maintain the repository, consider whether symlinks are truly necessary on Windows, or if you can:
- Use relative paths in configuration files
- Create Windows-specific setup scripts
- Document Windows setup requirements in README
Understanding Windows Symlink Security:
Historically, Windows restricted symbolic link creation because symlinks can be exploited in privilege escalation attacks. A malicious user could create a symlink pointing to a sensitive system file, then trick an elevated process into following the link and modifying the target.
Windows Vista introduced symlinks with this restriction. The SeCreateSymbolicLinkPrivilege privilege was required, typically only granted to Administrators.
Windows 10 version 1703 (Creators Update) relaxed this with Developer Mode, recognizing that developers frequently need symlinks and the security risk is manageable on development machines.
Git's Symlink Handling:
When Git stores a symlink:
1. It records the file mode as 120000 (symlink)
2. The file content is the target path (relative or absolute)
3. On checkout, Git reads the mode and creates either a symlink or regular file
When core.symlinks is false:
1. Git creates a regular file instead of a symlink
2. The file contains the symlink target as plain text
3. This allows checkout to succeed but breaks symlink functionality
WSL Interoperability:
If you use Windows Subsystem for Linux (WSL):
- WSL can create symlinks that Windows understands
- Git in WSL handles symlinks natively
- Symlinks created in WSL are visible as symlinks in Windows (with Developer Mode)
Consider using Git from within WSL for repositories with many symlinks.
Group Policy Restrictions:
In corporate environments, Group Policy may override local settings:
Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment > Create symbolic linksContact your IT department if you need symlink permissions but can't enable them yourself.
FAT32 and exFAT Limitations:
Symlinks only work on NTFS. If your repository is on a FAT32 or exFAT drive (common for USB drives), symlinks cannot be created regardless of permissions.
Cross-Platform Repositories:
For repositories shared between Windows and Unix systems:
1. Consider if symlinks are necessary - Many uses can be replaced with build scripts or configuration
2. Document Windows requirements - Include setup instructions in README
3. Use .gitattributes - You can specify how Git should handle specific files:
# Force specific files to be treated as symlinks
some/symlink symlink=true4. CI/CD considerations - Ensure your Windows build agents have symlink support
Checking Symlink Status:
# In Git Bash, check if symlinks are being used
git ls-files -s | grep '^12'
# Mode 120000 indicates symlinks
# Check a specific file's mode
git ls-files -s path/to/fileTroubleshooting Checklist:
1. Is Developer Mode enabled? (Settings > For developers)
2. Is core.symlinks true? (git config core.symlinks)
3. Is the filesystem NTFS? (not FAT32/exFAT)
4. Is antivirus interfering? (check exclusions)
5. Are there Group Policy restrictions? (gpedit.msc)
6. Was Git installed with symlink support? (reinstall if unsure)
warning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
fatal: Server does not support --shallow-since
Server does not support --shallow-since in Git
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server