Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include winln to properly create symbolic links #1999

Closed
1 task done
nngo opened this issue Dec 26, 2018 · 1 comment
Closed
1 task done

include winln to properly create symbolic links #1999

nngo opened this issue Dec 26, 2018 · 1 comment
Labels

Comments

@nngo
Copy link

nngo commented Dec 26, 2018

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.20.1.windows.1                                                                                             
cpu: x86_64                                                                                                               
built from commit: 7c9fbc07db0e2939b36095df45864b8cda19b64f                                                               sizeof-long: 4                                                                                                            
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

Windows 10 Pro 64-bit

$ cmd.exe /c ver

Microsoft Windows [Version 10.0.17134.472]
  • What options did you set as part of the installation? Or did you choose the
    defaults?

Using defaults.

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

No.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

ln -s target-file link-name
or
ln -s target-dir link-name
  • What did you expect to occur after running these commands?

A Windows symbolic link from target file (or target directory) to the link-name specified.

  • What actually happened instead?

A copy of the target was done to the link-name.

Possible solution:
Suggest at least including winln.exe in Git Bash for Windows (this package is available in msys and can be installed using pacman -Su winln when using Git for Windows SDK. The winln command checks that user has SeCreateSymbolicLinkPrivilege to create symbolic link.

FYI: winln currently does not check if Developer Mode is enabled and will abort creating symlink even though user can create symlinks when this is enabled.
See irakhlin/winln#1

@dscho
Copy link
Member

dscho commented Dec 26, 2018

I think the proper solution might be to expose the MSYS=winsymlinks:nativestrict mode in a more convenient way than having to set that environment variable. Maybe via some sort of /etc/nsswitch.conf knob, or something similar.

Including winln.exe (from wherever) and still having ln -s do the wrong thing, that would probably be the worst thing to do, as it would leave users with the same problem as you faced (unless they learn many details that they should not need to learn).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants