【发布时间】:2014-05-03 02:19:44
【问题描述】:
我尝试在 Windows 上制作 git hooks 来自动将存储库中的 unix 符号链接转换为本地机器上的硬链接+连接窗口。我该怎么做?我们混合使用基于 Windows 和 Unix 的操作系统。
我像这样扩展了 Git 的命令列表 Git Symlinks in Windows
我阅读了有关钩子的信息并创建了结帐后钩子:
#!/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 状态:
# On branch #branch_with_symlink
nothing to commit, working directory clean
git 没有 pre-checkout 钩子,我不明白,我是如何进行这种转换的
【问题讨论】:
-
我有同样的问题(同样的错误,即使没有更改也不允许我切换分支)。与您的不同之处在于我手动创建了连接点(在 Windows 8 中)。看来git有问题。如果您找到解决方案,请分享。