简体   繁体   中英

How do I make Git ignore symlink?

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/

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

NameOfSymlink
AnotherSymlink

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM