【发布时间】:2020-08-04 14:45:58
【问题描述】:
这是我在谷歌搜索超过 4 小时后得到的结果:
#!C:/Program\ Files/Git/bin/sh.exe
echo $SHELL
echo "here we go"
./PrePush/GitHook.exe
控制台告诉我:
/usr/bin/bash
here we go
.git/hooks/pre-push: line 4: ./PrePush/GitHook.exe: No such file or directory
我的 .exe 位于:C:\Users\myUsername\Documents\MyRepos\ProjectName\.git\hooks\PrePush\GitHook.exe
但它可能是我同事驱动器上的任何路径,所以我必须使用本地路径。
我已经尝试过bin/bash.exe,使用完整路径,使用system(./PrePush/GitHook.exe)(因为我认为它是一个perl脚本)
但他们都提出了错误。
而且似乎没有“只是”从 git 挂钩调用本地 .exe 的示例。
【问题讨论】: