I can't get this to work.
I have cloned a repository that has a dummy file (named src): /path/src
.
On Windows I have created a symbolic link: mklink -d /path/src /otherplace/src
(but I of course had to delete the dummy src file first).
In both my .gitignore
and .git/info/exclude
I have
/path/src/
/path/src
path/src/
path/src
And I have tried
git ls-files -s | gawk '/120000/{print $4}'
git update-index path/src/ --assume-unchanged
but I still get:
error: readlink("path/src"): Function not implemented
error: unable to index file path/src
fatal: updating files failed
I have tried all these other suggestions. And even this doesn't work.
Any ideas?
Git does not follow symbolic links when accessing a . gitignore file in the working tree. This keeps behavior consistent when the file is accessed from the index or a tree versus from the filesystem.
Although Git supports symlinks, I would strongly recommend against storing them as links in your repository, especially if you're also working with that code on Windows.
Symlinks, or symbolic links, are “virtual” files or folders which reference a physical file or folder located elsewhere, and are an important feature built in to many operating systems, including Linux and Windows. The Windows' NTFS file system has supported symlinks since Windows Vista.
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.
You can do a checkout ignoring this single file like this:
git checkout HEAD . --no path/src
The .gitignore
file only works for adding stuff to the index. Even a modifications on files commited before adding it to the .gitignore
are not ignored.
I know this is late, but I ran into this issue.
In my case, I apparently had checked in my symlink at some point. So no matter what I did, .gitignore
would not work (I think that is what Alexandre was getting at).
REPAIR:
Now you can re-add your symlinks and .gitignore
should work.
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