Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save huenisys/1efb64e57c37cfab7054c65702588fce to your computer and use it in GitHub Desktop.

Select an option

Save huenisys/1efb64e57c37cfab7054c65702588fce to your computer and use it in GitHub Desktop.
Enable symbolic links for Git on Windows 10
@James-E-A
Copy link

@maphew HKEY_LOCAL_MACHINE requires administrator access to modify.

@maphew
Copy link

maphew commented Aug 26, 2024

err, yes. I c/should have noted that @James-E-A.
For sake of completeness, it's my understanding that hard- and directory junction links also require admin privs on Windows (each time they're made).

@James-E-A
Copy link

@maphew no, actually; the reason I wished Git would check out symlinks locally as directory junctions is that you can create them as an unprivileged user on Windows, and they provide a UX almost identical to Linux's symlinks.

@maphew
Copy link

maphew commented Aug 26, 2024

"By default, only Administrators can create symbolic links. The security setting 'Create symbolic links' can be granted at: Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\

Creating a symbolic link requires elevation, but from Windows 10 build 14972, symlinks can be created without needing to elevate the console as administrator - this does however require that you have Developer Mode enabled."

-- https://ss64.com/nt/mklink.html

@James-E-A
Copy link

This defect is being tracked at https://lore.kernel.org/git/681f8e65b4d3cf82a5920840aa8dc88bde812964.1548771561.git.gitgitgadget@gmail.com/

Hopefully, soon, Git will just "do the right thing" and check out intra-repo directory symlinks as junctions when running in non-Developer mode Windows

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