interstar
interstar

Reputation: 27186

BFG-repo-cleaner and pushing back to GitHub

I'm trying to follow the tutorial instructions here : https://rtyley.github.io/bfg-repo-cleaner/

I clone a new copy of my github based repo with --mirror

I follow the instructions for running bgf and reflog

My local repository has now removed the big blog. Great.

When I go to push back to github I get

To github.com:interstar/myproject.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '[email protected]:interstar/myproject.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.

So I try to git pull from github to ensure sync. (Even though this repository was cloned cleanly from github at the start of the process)

And it pulls down all the blobs I want to get rid of. So my repo is back up to its previous size.

So I run bfg and reflog again. Nice small repo.

Try to push back to github

Same error message.

What am I missing?

Upvotes: 2

Views: 1290

Answers (1)

interstar
interstar

Reputation: 27186

OK.

I solved this. It was my own stupid fault, but leaving the question in case anyone else does the same thing.

Although the first time I cloned the repo from github I used --mirror, at some point I tried again and forgot to use the --mirror option.

When I started over with that option it worked as the tutorial suggested.

Upvotes: 2

Related Questions