git bash can't create symlinks

Juan Carlos RR 56 Reputation points
2022-10-03T19:33:08.363+00:00

I try to clone a repository and compile its code from gitbash and msys2, the problem is that bash cannot create symbolic links, nor is it able to follow them, when trying to clone a repository that includes symbolic links an error occurs indicating the following:
unable to create symbolic link, access denied.
I assumed that it was the administrator permissions, I used gitbash with elevated permissions but I received the same error, in the msys2 community and in github they suggest that I use bsdtar to uncompress a tarbal, they do not mention anything about cloning repositories, for testing I downloaded the repository as zip with the function offered by github, in this way if I can unzip it without errors, but when I try to compile the program the compilation system tries to create the symbolic links producing the error indicated above: cannot create the symbolic link, access denied .
I have used the fsutil utility to change the evaluation values ​​of symbolic links in the following way: l2l:1 r2l:1 r2r:1 l2r:1, everything is correct but when I try to compile again the same error occurs, I have also changed the policy of acquisition of rights for the creation of symbolic links adding my user to the list of allowed users, my user belongs to the administrators group, but even so the same error continues to occur, I don't see a possible solution, is there one?

Windows for business Windows Client for IT Pros Devices and deployment Configure application groups
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,916 Reputation points
    2022-10-06T08:33:11.407+00:00

    Hello there,

    Below are the child of points that have helped users to mitigate this issue

    If you are using a local web server on Windows (OpenServer, Laragon, Local), then start the server as an administrator.

    When installing git-bash for windows, there is an option called "Enable symbolic links". When you installed git-bash with that option I had the same issue as OP. So install the same setup (git-bash) again with that "Enable symbolic links" option unchecked.

    If you have are using Git for Windows SDK, you can install winln using the pacman package manager by running: pacman -Su winln

    Then you can run: winln -s target link, it will check that you have SeCreateSymbolicLinkPrivilege, otherwise it will fail. This is equivalent to running Window's mklink.exe.

    -----------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments

  2. Juan Carlos RR 56 Reputation points
    2022-10-07T23:31:22.597+00:00

    no, it is not correct, in a normal installation of git bash there is no option to enable symbolic links, (in the installer there is no such option), if you installed winln it would give the same result since the compilation scripts use ln and not winln, I think you did not understand my question or I did not know how to explain myself well

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.