Run git command from buildcst command

I want to fetch the latest changes from the remote and I have a step

git fetch origin +refs/changes/*:refs/remotes/origin/changes/*

      

configured as command line by calling git from C: \ Program Files (x86) \ Git \ cmd \ Git

However, when teamcity runs a team, it just waits and waits and waits.

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

      

Exit code 1 at 11:55 is a build stop because it took over a minute to run the pull command. I waited even longer.

Any help is appreciated.

+3


source to share


2 answers


Paul commented:

To debug such problems, you must log in to the agent and run the exact same command under the user who started the agent to process. Most likely he will hang himself too.



We used a git push to one of our build steps and it was hanging on the build server. What you may find is that you need to tell git that the checkout source is trusted and should always be trusted. It appears in the console when you first try to connect to an untrusted remote host.

Once you have done this once on one build agent, you will be able to copy the known_hosts file from the git linkers folder between all build agents.

0


source


do the same cmd in build agent the problem is probably missing from the remote host in the known_hosts file



-1


source







All Articles