我想从远程 pull 最新的变化,我有一个步骤
git fetch origin +refs/changes/*:refs/remotes/origin/changes/*
通过从 C:\Program Files (x86)\Git\cmd\Git 调用 git 配置为命令行
但是,当 teamcity 运行命令时,它只是等待,等待,等待..
Starting: C:\Windows\system32\cmd.exe /s /c ""c:\Program Files (x86)\Git\cmd\git" fetch origin"
[11:54:31]in directory: C:\BuildAgent\work\99b8cd174ffcc354
[11:55:04]Process exited with code 1
11:55 的退出代码 1 是我停止构建,因为运行获取命令需要一分多钟。我等得更久了。
感谢任何帮助。
最佳答案
帕维尔评论道:
To debug issues like this you should login to the agent machine and execute exactly the same command under the user who started agent process. Most likely it will hang too.
我们在构建步骤之一中使用了 git push,它卡在构建服务器上。您可能会发现,您需要告诉 git origin remote 是可信的,并且它应该始终是可信的。当您第一次尝试连接到不受信任的远程主机时,它会出现在控制台中。
在一个构建代理上完成一次此操作后,您应该能够从所有构建代理之间的构建代理 git 文件夹中复制 known_hosts 文件。
关于git - 从 teamcity buildstep 运行 git 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10034710/