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
Windows上用于符号链接转换的Git挂钩_Windows_Git_Hook_Symlink - Fatal编程技术网

Windows上用于符号链接转换的Git挂钩

Windows上用于符号链接转换的Git挂钩,windows,git,hook,symlink,Windows,Git,Hook,Symlink,我尝试在Windows上使用git钩子来自动将存储库中的unix符号链接转换为本地计算机上的硬链接+连接窗口。我该怎么做?我们混合使用基于Windows和Unix的操作系统 我像这样扩展了Git的命令列表 我阅读了有关挂钩的内容,并创建了签出后挂钩: #!/bin/sh exec git rm-symlinks 当我使用符号链接执行git checkout#branch_时,它是有效的,但当我执行下一次签出时,git写道: error: Your local changes to the fo

我尝试在Windows上使用git钩子来自动将存储库中的unix符号链接转换为本地计算机上的硬链接+连接窗口。我该怎么做?我们混合使用基于Windows和Unix的操作系统

我像这样扩展了Git的命令列表

我阅读了有关挂钩的内容,并创建了签出后挂钩:

#!/bin/sh
exec git rm-symlinks
当我使用符号链接执行git checkout#branch_时,它是有效的,但当我执行下一次签出时,git写道:

error: Your local changes to the following files would be overwritten by checkout:
#path_to_symlink
Please, commit your changes or stash them before you can switch branches.
git状态:

# On branch #branch_with_symlink
nothing to commit, working directory clean

git还没有预签出钩子,我不明白我是如何进行这种转换的,你可以尝试使用污迹过滤器,而不是使用钩子。与符号链接相比,它们更适合更改文本文件的内容,但我认为您可以让它们正常工作

这里有一些文档:

我有同样的问题(同样的错误,即使没有更改,也不允许我切换分支)。与您不同的是,我手动创建了连接点(在Windows 8中)。git似乎有问题。如果你找到了解决方案,请分享。