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

mklink /d creates symlink with wrong slashes #462

Closed
mikesigs opened this issue Apr 29, 2015 · 2 comments
Closed

mklink /d creates symlink with wrong slashes #462

mikesigs opened this issue Apr 29, 2015 · 2 comments

Comments

@mikesigs
Copy link
Contributor

This is a bit of an odd one. Here are the steps to reproduce the issue, and steps for a work around. Switch with your own local paths of course.

In Cmder, create a symbolic link to a directory:
mklink /d c:\blog c:\source\github\mikesigs.github.io

Now, using Brackets run the command brackets c:\blog

Brackets opens up, and the Brackets Git plugin reports the error "Invalid symlink c:/blog". Notice the forward slash in the error message. At first I thought this must be a bug with the plugin, but read on to see why I don't think that is actually the issue.

To demonstrate the problem might in fact be with Cmder (or Conemu) delete the symlink we just created: rmdir c:\blog. Now open up a regular cmd as Admin and run the mklink command again:
mklink /d c:\blog c:\source\github\mikesigs.github.io
Now open the folder in Brackets again: brackets c:\blog. This time, there is no error message reported by the Brackets Git plugin.

What could be going on here? Obviously it has something to do with msysgit, and how it swap slashes, but beyond that... I got nuthin.

Anyways, I have a work around so this isn't urgent (i.e. create symlinks using Windows cmd). But I figured I'd report the issue anyways.

@mikesigs
Copy link
Contributor Author

Okay, so apparently this is a known issue with Git itself and windows symlinks. The best solution is to use a junction instead of a symlink. So intead of mklink /d use mklink /j instead.

Moar info!

@cyrilcourtney
Copy link

Hello,
I just discovered cmder and got the same problem. It has however nothing to deal with Git.
When executed under cmder mklink produces rubbish. Same commands executed under cmd or tccle (from jpsoft) work like a charm.
Curious to know if 5 years later this would be fixed or shared by others.
All the best.

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

No branches or pull requests

2 participants