Skip to content

[ISSUE]: GitVersion complains about shallow repository in Azure DevOps #4094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
mc0re opened this issue Jul 15, 2024 · 1 comment
Closed
2 tasks done

Comments

@mc0re
Copy link

mc0re commented Jul 15, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

AzureDevops task

GitVersion version

5.12.0

Operating system

Windows

What are you seeing?

Just stumbled upon this error in an Azure pipeline executed on a home-made VM. Possibly I lack some setting somewhere.
Error

Running on: 'Azure Pipelines'
Disable Telemetry
Executing GitVersion
Command: git -C C:/agent/_work/1/s rev-parse --is-shallow-repository
C:\agent\externals\git\cmd\git.exe -C C:/agent/_work/1/s rev-parse --is-shallow-repository
true
##[error]The repository is shallow. Consider disabling shallow clones. See https://github.com/GitTools/actions/blob/main/docs/cloning.md for more information.

What is expected?

No error.

Steps to Reproduce

Create a VM in Azure, install the latest GIT and other tools.

Azure pipeline

    steps:
    - checkout: self
      clean: true
      fetchDepth: 0
      fetchTags: true
      submodules: recursive

    - task: gitversion/setup@1
      displayName: Install GitVersion
      inputs:
        versionSpec: $(GitVersionVersion)

    - task: gitversion/execute@1
      displayName: Determine current version
      inputs:
        useConfigFile: true
        configFilePath: ./GitVersion.yml

GitVersionVersion is 5.x

GitVersion.yml

mode: Mainline
branches:
  master:
    regex: ^master$|^main$

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

No response

@arturcic
Copy link
Member

If you see the error the tool is providing you will see the solution

##[error]The repository is shallow. Consider disabling shallow clones. See https://github.com/GitTools/actions/blob/main/docs/cloning.md for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants