git - 从 teamcity buildstep 运行 git 命令

标签 git teamcity

我想从远程 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/

相关文章:

bash - 将 Bash 脚本中的命令选项与字符串分开

git - 如何在 Flutter 和 Android Studio 中使用 git?

docker - Teamcity - 多个 docker 注册表凭证

version-control - 使用 TeamCity 进行程序集版本控制

powershell - 为什么我不能在 TeamCity 代理上的 PowerShell 中解压缩?

windows - 如何在 Windows 上更改远程/目标存储库 URL?

git - 使用 Git 如何查找本地和远程之间的更改

git - 在不创建提交的情况下设置 git 子模块

teamcity - 使用 TeamCity 构建后复制文件

git - Teamcity - 成功构建后创建 git 标签