问题
I wrote this script:
ECHO hi
cd "C:\config_folder"
"C:\Program Files (x86)\Git\bin\git" pull origin master
ECHO bye
I put this script on my remote server in this folder "C:\config_folder".
Now when i run this script from my local PC using this tool:
https://technet.microsoft.com/pl-PL/sysinternals/bb897553.aspx
C:\Users\ME\Desktop\PSTools>psexec.exe -u Administrator -p 123456 \\x.x.x.x "C:\config_folder\test.bat"
i get the following on my screen, the script is stuck on this git pull command in an infinite loop...no idea why...what did i miss?
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
回答1:
i fixed it, i needed to connect to the remote server with my user, not Admin, now the issue is solved. Thanks
来源:https://stackoverflow.com/questions/28987122/run-a-batch-file-on-a-remote-computer-to-update-a-git-branch