Windows服务端接收后git钩挂起

问题描述 投票:1回答:1

我已经在Apache服务器上设置了Git,并且一切正常。现在,我想设置一个接收后挂钩以启动Jenkins构建。

我已经编写了脚本并在服务器上对其进行了测试,没有问题。但是,当我执行git push时,它会到达“总计”行并停止:

C:\develop\.ws\git-repo>git push
Username for 'https://internal.git.repo.com': user
Password for 'https://[email protected]':
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 12 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 289 bytes | 289.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)

[在服务器上,我可以看到该脚本已尝试启动,但是该脚本已挂起并使用了一个内核的CPU:

enter image description here

由于该脚本似乎引起了问题,所以我只是通过重命名示例脚本来尝试删除该示例脚本,以删除“ sample”扩展名,但是表现出相同的行为。所以我将脚本更改为:

#!/bin/sh
exit 0

#!C:/git-2.25.1/bin/sh.exe
exit 0

但还是一样。

发生了什么事?

git apache githooks
1个回答
0
投票

已解决。上周末与IT人士交谈时,建议是用户过去用来运行Apache Server的原因。目前,该服务是使用“本地系统帐户”运行的。一旦更改为实际用户,sh.exe将不再挂起。

© www.soinside.com 2019 - 2024. All rights reserved.