# Pipeline getting conflict for get branch name

**URL:** <https://community.jenkins.io/t/pipeline-getting-conflict-for-get-branch-name/7714>\
**Category:** Ask a question\
**Tags:** question\
**Created:** [May 31, 2023, 8:26am UTC](https://community.jenkins.io/t/pipeline-getting-conflict-for-get-branch-name/7714 "2023-05-31T08:26:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maheshjenkins](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@maheshjenkins](https://community.jenkins.io/u/maheshjenkins)\
**Post date:** [May 31, 2023, 8:26am UTC](https://community.jenkins.io/t/pipeline-getting-conflict-for-get-branch-name/7714/1 "2023-05-31T08:26:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [May 31, 2023, 8:41am UTC](https://community.jenkins.io/t/pipeline-getting-conflict-for-get-branch-name/7714/2 "2023-05-31T08:41:00Z")

</div>

Hello @maheshjenkins and welcome to this community 👋

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

```bash
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. 🤷  
My $0.02.

---

<div class="post-metadata">

**Author:** ![maheshjenkins](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@maheshjenkins](https://community.jenkins.io/u/maheshjenkins)\
**Post date:** [May 31, 2023, 8:58am UTC](https://community.jenkins.io/t/pipeline-getting-conflict-for-get-branch-name/7714/3 "2023-05-31T08:58:24Z")

</div>

Thank you Bruno, will try to do that
