Pipeline getting conflict for get branch name

Hello Experts,

We have configure a project with github but we are getting below error msg when we run pipeline.
error msg:
stderr: error: cannot lock ref ‘refs/remotes/origin/develop’: ‘refs/remotes/origin/develop/1.0.0’ exists; cannot create ‘refs/remotes/origin/develop’.

we have try to change remove the directory but still it is refer to which local repo we are not able to identify. Kindly do the needful on it so that we will able to proceed further.

Hello @maheshjenkins and welcome to this community :wave:

I’m not a git expert nor a Jenkins expert, but what about adding temporary git steps to try and clean up?

sh 'git fetch --prune --all'
sh 'git reset --hard origin/develop'

Once executed once, retry running the pipeline without these steps to see if the error persists. :person_shrugging:
My $0.02.

Thank you Bruno, will try to do that

1 Like