How can I use symlinks with git on Windows?

  • Page Owner: Not Set
  • Last Reviewed: 2019-04-23

When I clone a repository that contains a symlink, it creates a text file on my machine with the text of the symlink in it instead of creating an actual symlink. How can I make this work?


Additional Posts

There are a couple complications with using symlinks in Windows:

  1. Very few Windows programs understand symlinks
  2. Creating symlinks required UAC elevation and administrative rights

So by default git does not come with support enabled out of the box.

But, you can enable it and it does work. Here's how I got it working:

  1. Uninstall your current version of git and install the latest. When going through the installer, ensure that the checkbox to enable symbolic link support is checked.
  2. Enable Windows Developer mode. In short: Open the Settings app in Windows, then search for developer, and choose Enable Developer Features

You may also need to set the config setting core.symlinks to true. Either globally:

git config --global core.symlinks=true

Or just for the repo you're checking out:

git clone -c core.symlinks=true <URL>

There is more information available in the git-for-windows wiki.