Cleaning bitbucket git repo with BFG repo-cleaner

I know this might be inappropriate place to ask this question, though i already asked it here and i really need answer for that asap, so maybe someone here already has experienced this problem.

At my job there were really bad habbit of adding jar file to git repo, some projects now have sizes of about 800mb, which is quite bad, so i decided to clean that up.
I chose bfg repo-cleaner since it’s a nice tool to delete unwanted files from git repo.
So i pretty much did the following steps:

  1. cloned git repo with mirror flag
  2. made backup of it
  3. run bfg cleaner to delete all jar files and folders named jar
  4. run git reflog expire --expire=now --all && git gc --prune=now --aggressive as suggested in guide
  5. and then tried to git push

first i tried on a small project, though it’s size were about 20mb i decided to clean most of our projects, since having jar files in repo is a bad practice.
All went well, all jar files were deleted and nothing was broken.
Then i tried same thing on a bigger project, though now step 5 failed, complaining about refused ref push:

You are attempting to update refs that are reserved for Bitbucket's pull request functionality. Bitbucket manages these refs automatically, and they may not be updated by users.

remote: Rejected refs:

remote: refs/pull-requests/34/from

After some searching i found out that this error occurs because of opened pull-requests, okay then i thought, i went to my project to see opened pull requests but there were NONE.
I even tried to use url from pull-request overview and changed it’s id to 34 and got into not existing page error.

So my question is how to resolve this? Can i remove this ref? Or should i consider something, mb someone had similar problem and found the way to solve it?

1 Like

I just got answer :slight_smile:

And this answer doesn’t work for me :C
Need help again

maybe, pull request is deleted.
i have same problem.