How to get Git on Windows to ignore symbolic links
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:
- Remove all symlinks
- See if git now thinks there are deleted files to commit.
- If so, then go ahead and commit the deletions.
Now you can re-add your symlinks and .gitignore
should work.
Here are my steps for this issue, similar, but a bit different from other answers.
Let's say I had a folder .fvm
contain file.json
and flutter_sdk(link)
that all commited in git before, then I want to ignore out flutter_sdk
.
- Add
.fvm/flutter_sdk
and.fvm/flutter_sdk/
in.gitignore
. - Cut
.fvm/flutter_sdk
out to other place than the repository. git add .
andgit commit ....
- Paste back the link.