我目前正在尝试通过VBScript脚本在我无法直接访问的服务器上的存储库上执行Git命令。显示当前分支或所有远程分支的基本命令有效。但是当我尝试切换或重置分支时,它会以128错误代码失败。这是代码:
If LCase(Request.QueryString("mode")) = "switch" Then
strShellResult = execShellScript("git -C C:\my-folder\my-repo checkout master")
Response.End
End If
Function execShellScript(command)
Dim strOutput
Dim objShell, objExec
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec("%comspec% /c "&shellComand)
If objExec.Status > 1 Then
strOutput = objExec.StdErr.ReadAll
Else
strOutput = objExec.StdOut.ReadAll
End If
Response.write "objExec.Status: "&objExec.Status&"<br>"
Response.write "objExec.ProcessID: "&objExec.ProcessID&"<br>"
Response.write "objExec.ExitCode: "&objExec.ExitCode&"<br>"
Response.write "strOutput: "&strOutput&"<br>"
Set objShell = Nothing
Set objExec = Nothing
execShellScript = strOutput
End Function
关于所有人。 git -C C:\my-folder\my-repo status
或git -C C:\my-folder\my-repo rev-parse --abbrev-ref HEAD
等命令有效。错误代码据说意味着:
没有子进程可供等待。
但这对我没有帮助。有人有想法吗?
感谢您的帮助,
努努
编辑1:管理以获取特定错误:致命:无法编写新索引文件。也许这会有所帮助。