DeCaf
DeCaf

Reputation: 6116

Discrepancy in GitVersion between local clone and repo checked out by Azure Pipelines

I have a branch in a repository for which GitVersion when run locally on a fresh clone returns one version (1.5.0-netcore1), but when running GitVersion on Azure Pipelines on the same branch it returns another version (1.4.1-netcore1). (Only the minor and patch versions are different in the entire output from gitversion).

I did setup a local agent, so I have the repository in a local folder on my computer as checked out by Azure Pipelines and the discrepancy is the same when I run gitversion in that folder as opposed to the one I cloned using git clone.

The results of running git tag and git branch on the two folders are the same, listing all branches and tags.

> git tag
1.3.0
1.4.0
> git branch
  archive/1.0
  archive/1.1
  archive/1.2
  develop
* feature/netcore
  gh-pages
  master

What could be different between those two clones of the same repository, and what can I do to make GitVersion behave the same?

For reference, the repository in question is https://github.com/alphaleonis/AlphaVSS/tree/feature/netcore

Upvotes: 1

Views: 263

Answers (1)

Levi Lu-MSFT
Levi Lu-MSFT

Reputation: 30343

I tested gitversion against your repository. I can reproduce the same discrepancy.

The discrepancy is fixed by git checkout master branch for the local folder your cloned using git clone. I found git clone your repository did not check out master automatically to local folder. It has to be done manually.However cloning using azure pipeline and visual studio will check out master as default.

It seems that gitversion uses some metadata of master branch to calculate the version.

Upvotes: 1

Related Questions