I have added a windows (window 7) symlink to my codebase ("foo" -> \\server\foo). I have a large set of configuration files under the networks share -\server\foo location. How do i check-in this symlink "foo" into my Git repo?
Any other user cloning the repo should get this link and should be able to pick up the files from the \\server\foo\ location.
The thought is to avoid repeated syncs of this large set of config files during integration builds
When i tried checking in, all the files under the \\server\foo location. When a user cloned the repo, "foo" was added as a simple directory.
Git for Windows does not support symlinks, which replaces with text files containing the path to the linked entry.
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.
On Windows 10, you can set up symlinks through the Command Prompt using the mklink command. First up, launch the Command Prompt by typing cmd in the Start menu search bar, then right-click the Best Match and select Run as administrator. You can use the mklink command to create hard and soft links.
Relative Symbolic Link : An relative symbolic link is an symbolic link, whose target has relative path. An relative path is path that is based on Current Working Directory. The path of target file/folder will be calculated according to the current path of symlink. Therefore, there is no definite path so as to say.
You need to create the right entries (special filemode 120000
) in the index in order to encode, and then decode symlinks in Windows.
See "Git Symlinks in Windows", espcially the aliases
git add-symlink
git checkout-symlinks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With