忽略 git 中的符号链接

发布于 2024-10-20 09:28:39 字数 293 浏览 7 评论 0原文

有没有办法让 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遥远的她 2024-10-27 09:28:40

在“忽略符号链接”方面,您可以设置 config core.symlinks< /code>配置变量为 false (作为 Windows Git 存储库中的本地配置):

符号链接将作为小纯文本签出包含其链接到的文件系统对象的路径的文件,但不创建所述目标对象。

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):

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文