忽略 git 中的符号链接
有没有办法让 git 完全忽略符号链接(将它们留在树中,但不在结帐时创建它们)?或者,有没有办法让 git 在 Linux 上的符号链接和 Windows 上的快捷方式之间进行转换?
上下文:我在 Windows 和 Linux 上使用 git 和一些 LaTeX 文件。在 Linux 上,我在存储库外部存储了大量样式文件,并从许多地方进行了符号链接。如果 git 将它们变成 Windows 上的快捷方式(我有相同的周围目录/文件结构),或者如果 git 完全忽略它们,并且不检查它们(我的 LaTeX 发行版中有样式文件),那么它会工作得很好视窗)。
Is there a way to make git completely ignore symlinks (leave them in the tree, but not create them on checkout)? Alternatively, is there a way to make git convert between symlinks on linux and shortcuts on windows?
Context: I'm using git with some LaTeX files on both windows and linux. On linux, I have a large number of style files stored outside the repo, and symlinked to from a bunch of places. 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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在“忽略符号链接”方面,您可以设置 config
core.symlinks< /code>
配置变量为
false
(作为 Windows Git 存储库中的本地配置):符号链接将作为小纯文本签出包含其链接到的文件系统对象的路径的文件,但不创建所述目标对象。
On the "ignoring symlink" side, you could set the config
core.symlinks
configuration variable tofalse
(as a local config within the Windows Git repo):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.