Is it possible to somehow get the number of commits in TeamCity?

Something like:

git rev-list --count <ветка> 

Or how to execute this command from TeamCity?

  • one
    Timing everything out of the box works. On 1 question - yes, on the second question, yes. - Senior Pomidor
  • what is your version? - Senior Pomidor
  • @SeniorAutomator 10. - romka.pm
  • why the number of commits? Do you want to include versioning? - Senior Pomidor
  • @SeniorAutomator Yes :) - romka.pm

1 answer 1

The number of commits can only be seen from the moment the configuration is created:

enter image description here

You can also run this command. TeamCity offers a large number of runners. specifically for this command, you can run Command Line (CMD \ bash)

only comms, that on the server or agent where you execute the command, Git must be installed and registered in the path enter image description here

  • Added information to Path to Git : C:\Program Files\Git\bin\git.exe . Trying to run, but an error occurs: git не является внутренней или внешней командой, исполняемой программой или пакетным файлом. - romka.pm Nov.
  • 2
    it is necessary to restart the timisti service so that the new environment will be pulled up. do not forget to specify the working directory, otherwise you will say that it is not a git repository - Senior Pomidor
  • fine! Thank. - romka.pm Nov.