So, what does Git do when you add a symbolic link to the index?
First, make a symbolic link:
$ ln -s /path/referenced/by/symlink symlink
Git doesn't know about this file yet. git ls-files
lets you inspect your index (-s
prints stat
-like output):
$ git ls-files -s ./symlink
[nothing]
Now, add the symbolic link to the index. When you add a file to the index, Git copies its contents in the object store.
$ git add ./symlink