# How to fix merge conflicts in PRs?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090%3E%5C
**Category:** 🤗Datasets\
**Created:** [June 20, 2025, 12:39pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090 "2025-06-20T12:39:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgaido91](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mgaido91](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmgaido91)%5C
**Post date:** [June 20, 2025, 12:39pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090%2F1 "2025-06-20T12:39:19Z")

</div>

Hi all,

I have a PR open on a dataset that has conflicts with the main branch ([FBK-MT/mosel · Granary](https://huggingface.co/datasets/FBK-MT/mosel/discussions/5)). Unfortunately, I cannot handle the repo using git as there is a logo in the readme and when I try to push from git I get:

```auto
remote: -------------------------------------------------------------------------
remote: Your push was rejected because it contains binary files.
remote: Please use https://git-lfs.github.com/ to store binary files.
remote: See also: https://hf.co/docs/hub/repositories-getting-started#terminal
remote: 
remote: Offending files:
remote: - mosel-logo-transparent.png (ref: refs/tags/v1.1)
remote: -------------------------------------------------------------------------

```

So I am not sure how to handle this. Is there any way to solve merge conflict with the UI or the HfApi? Do you have any suggestions?

Thanks!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [June 20, 2025, 2:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090%2F2 "2025-06-20T14:34:41Z")

</div>

I’m not familiar with git, but this case seems similar…

> [@Push Reject due to Binary Files](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-reject-due-to-binary-files%2F88990)%3A
>
> Hey everyone, so I updated the code for one of my HF space During which I had added a few images in image folder; Then I had commited these changes, but when I tried to push the code, I got this error: remote: ------------------------------------------------------------------------- remote: Your push was rejected because it contains binary files. remote: Please use https://git-lfs.github.com/ to store binary files. remote: See also: https://hf.co/docs/hub/repositories-getting-started#terminal…

---

<div class="post-metadata">

**Author:** ![mgaido91](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mgaido91](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmgaido91)%5C
**Post date:** [June 20, 2025, 5:25pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090%2F3 "2025-06-20T17:25:54Z")

</div>

Yes, that is the problem I get with git. The problem is that the solution requires rebuilding the repo from scratch. That is why I was looking for a way to solve conflicts from the UI of HfApi. Thanks.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [June 21, 2025, 12:45am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090%2F4 "2025-06-21T00:45:52Z")

</div>

Ah, I see. In that case, this function might be the closest option. If you set `create_pr` to `True`, it will probably become a PR waiting to be merged, so even if something goes wrong, there shouldn’t be any problems.

> **[HfApi Client](https://huggingface.co/docs/huggingface_hub/v0.33.0/en/package_reference/hf_api#huggingface_hub.HfApi.upload_folder.create_pr)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![mgaido91](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mgaido91](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmgaido91)%5C
**Post date:** [June 23, 2025, 8:42am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090%2F5 "2025-06-23T08:42:48Z")

</div>

I already have a PR open, the problem is that it has merge conflicts and I do not know how to solve them.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [June 23, 2025, 11:58am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090%2F6 "2025-06-23T11:58:37Z")

</div>

It seems that the only option available with hub Python library is to close the commit and make another commit…

> **[Interacting with Discussions and Pull Requests](https://huggingface.co/docs/huggingface_hub/en/package_reference/community)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![mgaido91](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mgaido91](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmgaido91)%5C
**Post date:** [June 23, 2025, 12:30pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-fix-merge-conflicts-in-prs%2F160090%2F7 "2025-06-23T12:30:24Z")

</div>

I see, that was my fear… that’s quite unfortunate as someone has to redo everything from scratch. Hope in the future there will be better options. Thanks for your replies.
