How to configure build number format on TeamCity when using Git source control

2

We have recently moved from Team Foundation Server (TFS) source control to Git source control. We are using TeamCity as our build server.

Our build number format in TeamCity is defined as this:

%env.Release%.%env.Patch%.%build.counter%.%build.vcs.number%

This gives us a build number like this:

24.9.2.34561

But after moving to GIT our build number looks like this:

29.4.179.4d549289e564929454d1e783319e2c3e5b45cd71

Can anyone tell me how to setup TeamCity to generate build number like this when using GIT source control:

xx.xx.xx.xxxxxx

bala

Posted 2019-08-22T12:06:51.180

Reputation: 21

That 4d549289e564929454d1e783319e2c3e5b45cd71 is most likely the Git hash for that commit/version of the deployed code. I would recommend seeing if build.vcs.number can be shortened to 7 characters (the typical short has Git uses) for your purposes. Look here for documentation.

– JakeGould – 2019-08-22T12:14:18.630

1Thanks i will try that! – bala – 2019-08-22T12:30:33.083

No answers