The problem is simple: one person pushed some unnecessary (and possibly private) info to origin
on Gitlab. I need to remove it.
I understand how to change history in git, and how to make it be just like I want it to be. So I actually cleaned the history and force pushed it to the origin
.
But the problem is that there is a merge request for this branch which collects all pushed versions of this branch (including this unnecessary info). So I decided to remove this merge request. It is not such trivial task (it can't be done through GUI), but after some search I found that this can be done through Gitlab API like this:
curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/4/merge_requests/85
(look https://docs.gitlab.com/ee/api/merge_requests.html#delete-a-merge-request).
After that I ran "Housekeeping" from Project Settings on Gitlab which should do garbage collecting, but repository size haven't changed. I checked and yes - bad commits are still reachable by https://gitlab.com/<PROJECT>/commit/<HASH>
. So it seems there are other things which don't allow these commits to be removed.
What should I do to prevent possible private info leak and to shrink repository from origin
's ~130MB to my local .git/
~30 MB.
P.S. I know about hardcore solution with creating new project and importing old one to it - it is not what I want.
P.P.S. I use Gitlab-hosted server so I can't (or can I?) just open ssh console and remove some files / database entrances manually.
UPD. Through API I got list of origin
commits (https://docs.gitlab.com/ee/api/commits.html#list-repository-commits). Bad commits were not in this list, so this list should be identical to my local commit list.