Short version: there is no exact equivalent for POSIX symlinks on Windows, and the closest thing is unavailable for non-admins by default. Therefore, symlink emulation support is switched off by default and needs to be configured by you, the user, via the `core.symlinks=true` config setting.
Starting with Windows Vista, there is support for symbolic links. These are not your grandfather's Unix symbolic links; They differ in quite a few ways:
- Symbolic links are only available on Windows Vista and later, most notably not on XP
Symbolic links 只在Windows Vista 和更新的版本中可用,XP中不可用。
> Symbolic links 只在Windows Vista 和更新的版本中可用,XP中不可用。
- You need the `SeCreateSymbolicLinkPrivilege` privilege, which is by default assigned only to Administrators and guarded by UAC, but can be assigned to other users or user groups (see below).
- Symbolic links will only work on NTFS, not on FAT nor exFAT
Symbolic links 只能作用在NTFS文件系统中,不能用于FAT和exFAT
> Symbolic links 只能作用在NTFS文件系统中,不能用于FAT和exFAT
- Windows' symbolic links are typed: they need to know whether they point to a directory or to a file (for this reason, Git will update the type when it finds that it is wrong)
Windows 的Symbolic links是有类型的:它们需要知道它们被指向的是目录还是文件(因此,Git在发现错误时会更新类型)
> Windows 的Symbolic links是有类型的:它们需要知道它们被指向的是目录还是文件(因此,Git在发现错误时会更新类型)
- Many programs do not understand symbolic links
许多程序不能识别symbolic links
> 许多程序不能识别symbolic links
For those reasons, Git for Windows disables support for symbolic links by default (it will still read them when it encounters them). You can enable support via the `core.symlinks` config variable, e.g. when cloning:
因为这些原因,Git for Windows 默认禁用了对Symbolic links的支持(当遇到symbolic links时,Git仍然会读取它们)。你可以通过修改配置项`core.symlinks`的值来启用对Symbolic links的支持,例如在`clone`仓库的时候:
> 因为这些原因,Git for Windows 默认禁用了对Symbolic links的支持(当遇到symbolic links时,Git仍然会读取它们)。你可以通过修改配置项`core.symlinks`的值来启用对Symbolic links的支持,例如在`clone`仓库的时候: