Windows 上的 Git : how to get pre-receive hook to run on the server using a file share

标签 git githooks

不幸的是我必须在 Windows 上运行 git。

我正在使用 Windows 共享来共享 git 存储库(例如//ip 地址/GitRepo.git)

问题是 git 似乎将此视为本地路径并在客户端上运行预接收 Hook !

例如如果我的预接收钩子(Hook)包含以下内容:

echo $(ls /C)

然后我看到的是客户端C盘的内容,而不是服务器的内容

如何让预接收 Hook 在服务器上运行?

最佳答案

没关系。只需使用 SSH 而不是 Windows 共享

关于Windows 上的 Git : how to get pre-receive hook to run on the server using a file share,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16734549/

相关文章:

bash - Visual Studio Code "Git not found"

git - 我如何使用 git bisect 找到第一个 GOOD 提交?

git - 可以在预提交的git hook中重新登台文件吗?

git - 如何在 Git 中提交后自动推送?

bash - 从通过 post-receive 钩子(Hook)创建的 ssh session 调用时,导出不起作用

linux - 从 Git 获取单个文件版本

macos - 致命的 : could not parse HEAD Error When Committing

git - 如何显示我的全局 Git 配置?

git - 如何阻止 root 运行 git pull?

git - 从 git 预提交 Hook 运行时 `git diff` 不起作用