26

I have symlinks in my project folder so that large directories of videos and images are accessible when I am running project in local dev server on my windows 10 machine.

The problem with this is that Git wont let me do "add ." because when symlinks are present it gives me this error:

error: readlink("ProjectName/SymlinkName"): Function not implemented
error: unable to index file ProjectName/SymlinkName
fatal: adding files failed

I have added the symlinks to the .gitignore but this didn't change anything.

I am cautious about making them hardlinks inside my dev project. Is this my only option?

Edit:

My gitignore looke like this:

NameOfSymlink/
AnotherSymlink/
Guerrilla
  • 13,375
  • 31
  • 109
  • 210
  • You ignore symlinks the same way you ignore any other files. Post the relevant .gitignore lines and output of `git status` please. – 1615903 Nov 07 '16 at 08:20
  • @1615903 git status shows the symlink folders as untracked. I have added their relative path to the .gitignore in the parent folder as well as subfolder in the same way that I have ignored other folders. It works for normal folders but not symlinks folders – Guerrilla Nov 07 '16 at 08:52

1 Answers1

57

Git considers symlinks to be files, not directories. You need to remove the / at the end of each .gitignore line:

NameOfSymlink
AnotherSymlink
1615903
  • 32,635
  • 12
  • 70
  • 99
  • 8
    In my case it only worked, when doing a slash in front like `/NameOfSymlink` at Git version 2.1.4. Anyway removing the trailing slash is important. Thank you. – Markus Zeller Dec 11 '18 at 09:42