Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 1
    All of my local repositories have core.symlinks=false which would override your solution. Any idea what is producing this local configuration automatically? Possibly installing Git for Windows without checking the checkbox? Commented Feb 25, 2020 at 22:58
  • 1
    Also you have to re-clone repository to make symlinks work with it Commented Aug 27, 2021 at 12:00
  • 2
    No need to re-clone, fixing the repo's config should be enough. This helps if git config core.symlinks still returns false in your repo, while git config --global core.symlinks says true. Run git config --unset core.symlinks; note: no --global! Commented Apr 21, 2022 at 19:15
  • 15
    If you don't want to enable developer mode, you can simply set symlink permission to your account: Press Win + R, type gpedit.msc, hit OK. Then navigate to Local Comp Policy > Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment > Create symbolic links, open that option and add your user account. Commented Oct 10, 2022 at 15:49
  • 6
    Windows mklink distinguishes between "file symbolic links" and "directory symbolic links" (mklink /d). If a repo's symbolic link refers to a directory defined in a submodule, and the submodule has not yet been downloaded, git creates a file symbolic link, which won't work. This results in the vexing "The directory name is invalid" error. The fix it to delete the symlink in the working copy, then restore it with git checkout. Since the target directory now exists, git (correctly) creates a directory symbolic link. This process doesn't result in any change to the repository. Commented Dec 12, 2023 at 13:55