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:
- cloned git repo with mirror flag
- made backup of it
- run bfg cleaner to delete all jar files and folders named jar
- run git reflog expire --expire=now --all && git gc --prune=now --aggressive as suggested in guide
- 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?