Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add symlinks to git repository on Windows?

I compile binaries for OS X using GitHub' s electron environment and want to add the output to a git repository.

I tried

git add .
error: readlink("sulu.app/Contents/Frameworks/Electron Framework.framework/Electron Framework"): Function not implemented
error: unable to index file sulu.app/Contents/Frameworks/Electron Framework.framework/Electron Framework
fatal: adding files failed

Any idea to work around this?

like image 783
Stephan Ahlf Avatar asked Jul 05 '15 17:07

Stephan Ahlf


People also ask

Does Git support symlinks on Windows?

Git for Windows does not support symlinks, which replaces with text files containing the path to the linked entry.

Can you do symlinks in Windows?

Windows 11, 10, 8, 7, and Vista all support symbolic links — also known as symlinks — that point to a file or folder on your system. You can create them using the Command Prompt or a third-party tool called Link Shell Extension.

Can you add symlinks to Git?

Git can track symlinks as well as any other text files. After all, as the documentation says, a symbolic link is nothing but a file with special mode containing the path to the referenced file. Knowing how to handle links is the OS job.


1 Answers

Windows command

mklink /H "Link_File_Path" "Target_File_Path"

Use above command to create a hard link for all your output files. That will work. I did similar stuff for git hooks.

Refer this link for more info about mklink http://ss64.com/nt/mklink.html

like image 138
Suluvai Avatar answered Sep 23 '22 01:09

Suluvai