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

时间:2014-03-25 10:06:19

标签: windows git hook symlink

我尝试在Windows上制作git hooks,自动将位于存储库中的unix符号链接转换为本地机器上的hardlinks + junctions窗口。我怎么可能这样做?我们使用基于Windows和Unix的操作系统。

我扩展了Git的命令列表,如Git Symlinks in Windows

我读了关于钩子并创建了post-checkout hook:

#!/bin/sh
exec git rm-symlinks

它有效,当我执行git checkout #branch_with_symlink时,但是当我下次检查时,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 status:

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

git避免了结账前钩,我不明白,我是如何进行这次转换的

1 个答案:

答案 0 :(得分:1)

您可以尝试使用涂抹过滤器,而不是使用钩子。它们的设计目的是改变文本文件的内容而不是符号链接,但我认为你可以让它们起作用。

此处提供了一些文档:http://git-scm.com/docs/gitattributes#__code_filter_code

相关问题