Kerbol
Kerbol

Reputation: 696

Using Git Commands in TeamCity

I want to return the results from a GIT command in my TeamCity build log. Unfortunately, I cannot using GIT commands within the Build Steps as the commands are not recognized. Any idea how I can return the results on my GIT command? Preferably, I would like to be able to pass the results to a parameter.

FYI, the git command I am using is to return the latest merged pull requests;

git log --grep="Merge pull request #[0-9]\+" --pretty=oneline -1

Upvotes: 1

Views: 1241

Answers (1)

cyberskunk
cyberskunk

Reputation: 1772

You need to select "Always checkout files on agent" in a Version Control Settings page. This requires you to install git on the agents.

Unlike server checkout, Agent checkout creates all the necessary VCS-specific folders (e.g. .git) and makes it possible to run git commands.

More details could be found in TeamCity documentation on VCS Checkout Mode.

Upvotes: 3

Related Questions