If you have WSL2 installed (if not, see @Peeter Joot's answer) , you can easily clone a project with symlinks into a Windows directory.
To be explicit, the following project has 4 symlinks below the os/test/resources directory, 2 of which are broken by design: com-lihaoyi/os-lib, so it's not possible to clone using the cygwin or msys2 version of git.
From a WSL2 Ubuntu bash session, I was able to clone it into my C:\Users\username\workspaces folder.
cd /mnt/c/Users/username/workspace/ git clone https://github.com/com-lihaoyi/os-lib.git cd os-lib/ From a cygwin or msys2 session, you can verify that the symlinks are as expected:
# verify symlinks: ls -ltrad $(find os/test/resources -type l) lrwxrwxrwx 1 username None 13 Jun 10 10:55 os/test/resources/test/misc/broken-abs-symlink -> /doesnt/exist lrwxrwxrwx 1 username None 6 Jun 10 10:55 os/test/resources/test/misc/broken-symlink -> broken lrwxrwxrwx 1 username None 11 Jun 10 10:55 os/test/resources/test/misc/file-symlink -> ../File.txt lrwxrwxrwx 1 username None 10 Jun 10 10:55 os/test/resources/test/misc/folder-symlink -> ../folder1 As a side-effect, when I did git diff from cygwin, some file permissions had been changed from 644 to 744.
To restore file permissions:
git config --unset --localrestore core.fileMode Finally:
$ git status On branch main Your branch is up to date with 'origin/main'. nothing to commit, working tree clean