忽略git中的符号链接 [英] Ignoring symlinks in git

查看:296
本文介绍了忽略git中的符号链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让git完全忽略符号链接(将它们留在树中,但不在结帐时创建它们)?另外,有没有办法让git在Linux上的符号链接和Windows上的快捷方式之间进行转换?



上下文:我在Windows和Linux上都使用git和一些LaTeX文件。在Linux上,我有大量的样式文件存储在回购之外,并且从一堆地方符号链接到。它会工作得很好,如果git把它们变成windows上的快捷方式(我有相同的周边目录/文件结构),或者如果git完全忽略它们,并且不检查它们(我的LaTeX发行版中有样式文件在忽略符号链接一侧,你可以设置 config core.symlinks 配置变量为 false (作为Windows Git仓库中的本地配置):

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


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

解决方案

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.

这篇关于忽略git中的符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆