简体   繁体   English

忽略git中的符号链接

[英]Ignoring symlinks in git

Is there a way to make git completely ignore symlinks (leave them in the tree, but not create them on checkout)? 有没有办法让git完全忽略符号链接(将它们保留在树中,但不能在结帐时创建它们)? Alternatively, is there a way to make git convert between symlinks on linux and shortcuts on windows? 或者,有没有办法在Linux上的符号链接和Windows上的快捷方式之间进行git转换?

Context: I'm using git with some LaTeX files on both windows and linux. 上下文:我在Windows和Linux上使用git和一些LaTeX文件。 On linux, I have a large number of style files stored outside the repo, and symlinked to from a bunch of places. 在linux上,我有大量的样式文件存储在repo之外,并且从一堆地方符号链接。 It'll work fine if git turns them into shortcuts on windows (I have the same surrounding directory/file structure), or if git ignores them completely, and doesn't check them out (I have the style files in my LaTeX distribution on windows). 如果git将它们转换为Windows上的快捷方式(我有相同的周围目录/文件结构),或者如果git完全忽略它们,并且不检查它们(我的LaTeX发行版中有样式文件),它将正常工作视窗)。

On the "ignoring symlink" side, you could set the config core.symlinks configuration variable to false (as a local config within the Windows Git repo): 在“忽略符号链接”方面,您可以将config core.symlinks配置变量设置为false (作为Windows Git core.symlinks中的本地配置):

Symlinks would be checked out as small plain text files that contain the path of the file system object that it links to, but without creating said target object. 符号链接将被检出为小的纯文本文件,其中包含它链接到的文件系统对象的路径,但不创建所述目标对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM