Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何让GIT在Windows上将目录连接视为常规文件夹?_Windows_Git_Visual Studio_Version Control_Junction - Fatal编程技术网

如何让GIT在Windows上将目录连接视为常规文件夹?

如何让GIT在Windows上将目录连接视为常规文件夹?,windows,git,visual-studio,version-control,junction,Windows,Git,Visual Studio,Version Control,Junction,我需要共享在不同项目之间共享某些文件。因此,我的文件结构如下: D:\shared\ D:\shared\files-shared-by-all-projects-here D:\project1\ D:\project1\project1-specific-files-here D:\project1\shared <- directory junction to D:\shared D:\project2\ D:\project2\project2-specific-files-h

我需要共享在不同项目之间共享某些文件。因此,我的文件结构如下:

D:\shared\
D:\shared\files-shared-by-all-projects-here

D:\project1\
D:\project1\project1-specific-files-here
D:\project1\shared <- directory junction to D:\shared

D:\project2\
D:\project2\project2-specific-files-here
D:\project2\shared <- directory junction to D:\shared
D:\shared\
D:\shared\此处所有项目共享的文件
D:\project1\
D:\project1\project1此处的特定文件

D:\project1\shared目前不支持此操作。这是由于Git for Windows和libgit2之间的连接处理在解释上存在差异,libgit2是VisualStudio和(部分)TortoiseGit使用的Git库

已经决定两个实现都应该这样做,但是目前两个实现实际上都没有这样做

目前,Git for Windows将它们视为普通目录(因此它可能会删除您的连接并用新目录替换)。libgit2将此视为一个符号链接,因此VisualStudio拒绝处理它


由于Microsoft需要更新Visual Studio来修复此问题,请在上提交一个bug,并鼓励人们投票支持它,希望它能在VS 2015中得到修复。

感谢您的明确解释!你能推荐一些实用的解决方法吗?或者只有创建一个“共享”回购协议并不时手动提交给它?也许有一些git选项可以切换?我用true和false对core.symlinks进行了测试,但这似乎没有任何作用。恐怕没有真正的解决方法,您需要使用共享存储库、手动复制或使用子模块类型的方法。感谢您提供的信息。如果我将目录连接更改为目录符号链接,它仍然不起作用吗?不-IIRC,在Visual Studio中将没有效果(它已经将它们视为符号链接),而Git for Windows将停止工作(因为它处理符号链接的方式与连接不同)。Git拒绝通过符号链接进行写入,出于安全考虑将其删除。