Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 在远程计算机上运行批处理文件以更新git分支_Windows_Git_Batch File_Psexec - Fatal编程技术网

Windows 在远程计算机上运行批处理文件以更新git分支

Windows 在远程计算机上运行批处理文件以更新git分支,windows,git,batch-file,psexec,Windows,Git,Batch File,Psexec,我写了这个剧本: ECHO hi cd "C:\config_folder" "C:\Program Files (x86)\Git\bin\git" pull origin master ECHO bye 我将此脚本放在远程服务器的“C:\config\u folder”文件夹中 现在,当我使用此工具从本地PC运行此脚本时: 我在屏幕上看到以下内容,脚本在无限循环中被困在这个git pull命令上…不知道为什么…我错过了什么 我修复了它,我需要用我的用户而不是管理员连接到远程服务器,现在

我写了这个剧本:

ECHO hi
cd "C:\config_folder"
"C:\Program Files (x86)\Git\bin\git" pull origin master
ECHO bye
我将此脚本放在远程服务器的“C:\config\u folder”文件夹中

现在,当我使用此工具从本地PC运行此脚本时:

我在屏幕上看到以下内容,脚本在无限循环中被困在这个git pull命令上…不知道为什么…我错过了什么




我修复了它,我需要用我的用户而不是管理员连接到远程服务器,现在问题解决了。谢谢

您确定它在正确的文件夹中运行吗?可能git pull是在当前目录中执行的,而不是在git report中执行的,因为它运行在正确的文件夹中。这就是为什么我在脚本中添加了:cd“C:\config\u folder”。如果您站在该文件夹中,并在bash中执行该命令,它是否也可以工作?是的。我在远程服务器上运行了脚本,它运行得很好。但是从远程来看,当我用这个工具从我的PC上运行脚本时,我得到了这个行为,你可以看到“echo”正在工作,所以问题是“git pull…”你的repo的url是什么?http?吉特?嘘?也许它会提示你输入密码
C:\Users\ME\Desktop\PSTools>psexec.exe -u Administrator -p 123456 \\x.x.x.x "C:\config_folder\test.bat"
C:\Windows\system32>ECHO hi
hi

C:\Windows\system32>cd "C:\config_folder"

C:\config_folder>"C:\Program Files (x86)\Git\bin\git" pull origin master