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

Cek*_*oke 5 windows git hook symlink

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

我像Windows中的Git Symlinks一样扩展了Git的命令列表

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

#!/bin/sh
exec git rm-symlinks
Run Code Online (Sandbox Code Playgroud)

它可以工作,当我执行git checkout #branch_with_symlink时,但当我做下一次checkout时,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.
Run Code Online (Sandbox Code Playgroud)

git状态:

# On branch #branch_with_symlink
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)

git没有预先签出钩子,我不明白,我是如何进行这种转换的

And*_*ett 1

您可以尝试使用污迹过滤器,而不是使用挂钩。它们更适合更改文本文件的内容而不是符号链接的内容,但我认为您可以让它们工作。

这里有一些文档:http ://git-scm.com/docs/gitattributes#__code_filter_code