! [remote rejected] after deleteing big blob

340 Views Asked by At

I wish to remove an old big blob from my repo history so I did the following:

git clone --mirror [email protected]:$USER/my-repo
cd my-repo.git
java -jar $HOME/bin/bfg-1.14.0.jar --delete-files big-file.tar.gz
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push --force

the push operation results in

! [remote rejected]   refs/environments/production/deployments/1 -> refs/environments/production/deployments/1 (deny updating a hidden ref)
! [remote rejected]   refs/environments/production/deployments/10 -> refs/environments/production/deployments/10 (deny updating a hidden ref)
! [remote rejected]   refs/environments/production/deployments/102 -> refs/environments/production/deployments/102 (deny updating a hidden ref)
! [remote rejected]   refs/environments/production/deployments/1058 -> refs/environments/production/deployments/1058 (deny updating a hidden ref)
! [remote rejected]   refs/environments/production/deployments/1062 -> refs/environments/production/deployments/1062 (deny updating a hidden ref)
...

PS: the offending file has been removed from the repo but obviously is still present in the repo history.

How can I remove the file AND update the remote repository so that any subsequent git pull will be smaller ?

0

There are 0 best solutions below