Contents
What does git do with symbolic links?
Git just stores the contents of the link (i.e. the path of the file system object that it links to) in a ‘blob’ just like it would for a normal file. It then stores the name, mode and type (including the fact that it is a symlink) in the tree object that represents its containing directory.
Does Git work with symbolic links?
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. Knowing how to handle links is the OS job.
How can I use symbolic links in Git?
Symbolic links are a great way to simplify mundane tasks such as having the same configuration file in different folders. If you are not familiar with symbolic links, symlinks for short, I recommend reading the manpage for the ln command, or this post. Git can track symlinks as well as any other text files.
How are symlinks checked out in git config?
How Git deals with symlinks is defined in the git config core.symlinks . If false, symbolic links are checked out as small plain files that contain the link text. Otherwise, Git just stores the contents of the link (i.e., the path of the file system) in a ‘blob’ just like it would for a normal file.
Why does a link not work in Git?
The reference path of the source file should be relative to the repository, not absolute to the machine. The reason for this is that given that a symlink contains the path to the referenced file, if the path is relative to a specific machine the link won’t work on others.
What does it mean to recommend something in Git?
Recommending means this is a discussion worth sharing. It gets shared to your followers’ Disqus feeds, and gives the creator kudos! For anybody searching for answer how to make git add content of the folder referenced by symlink – you should create junction, not symlink or hardlink. For windows – it’s “mklink /J”.