Tuesday, January 21, 2014

TFS Build: Build from a Git tag

The TFS Build system not only works fine with Team Foundation Version Control but also with Git.

I was looking for a way to specify the git tag(similar to a label in the TFS Version Control) inside a build definition.

However when I created a new build definition, I couldn’t find a relevant option in the build process parameters:

image

The trick is that you don’t need to use the Default Template(GitTemplate.xaml) but switch to a newer version:

image

After doing that I can specify a tag id in the Checkout override field:

image

Remark: By default you have to type the tag id yourself(with a change of typo’s). To select the tag id from a list of possible values, have a look at the following post on StackOverflow that explains how to configure a custom editor: http://stackoverflow.com/questions/19434527/how-to-setup-tfs-2013-build-definition-to-build-from-git-tag

1 comment:

Anonymous said...

Hello, do you have any info on this subject for TFS 2015? Is it still possible to build from git tag?