Skip to content

Error / GitVersion with Jenkins multi-branch pipeline project #1335

Closed
@vader1986

Description

@vader1986

This might be related to #912 .

With the default configuration of a multi-branch pipeline project in Jenkins, it's complaining:

An unexpected error occurred: System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.

If I do git fetch --all after checkout, I'm getting:
LibGit2Sharp.LibGit2SharpException: ref '...' doesn't match the destination

Interestingly enough, it works, when I

  1. change the default Jenkins configuration (which we cannot do in production!) to fetch refspec for latest master
  2. and to checkout the current branch locally
  3. and I run git checkout master followed by git checkout ${GIT_BRANCH} in the Jenkins pipeline file

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions