Jenkins builds fail with error unsupported option accept-new in OCP 4

Solution Verified - Updated -

Issue

  • Jenkins builds are failing with the below error:
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
The recommended git tool is: NONE
using credential productcore-product-core-stash
Cloning the remote Git repository
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@<GIT_REPO_URL>.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: command-line line 0: unsupported option "accept-new".
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  • The checkout stage throws the error.
    stderr: command-line line 0: unsupported option "accept-new".

Environment

  • Red Hat OpenShift Container Platform 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content