Fixing a Broken GitHub Repo

Fixing a Broken GitHub Repo

Don't Push Enormous Files to GitHub!

Pay close attention to the statement above!  A couple of days ago I was working on content for Tama-Toledo Community Visioning and I added a large file to the source repo, and then very stupidly pushed it to GitHub and the repo's main branch. Naturally, the push didn't finish so I removed the file and pushed a new commit to "remove it permanently". Well, that ain't how git works!

The "remove" commit appeared to have worked, but now the TTCV site wouldn't deploy since the build time had gone from less than 2 minutes, to more than 10 minutes. I immediately became suspicious of that pesky, large, file, but how could I properly get rid of it?

Using git filter-repo

Fortunately, I found and followed the GitHub docs guidance in Using git filter-repo to remove the troublesome large file, namely, from the repo. The commands I used to do this included...

The above command was necessary because the next command expects a "clean", recently compressed local repository.

It Worked!

The good news, this worked, and I now have my repo back in shape such that I can successfully deploy it again.

That's a wrap. Oh, in case you want to know what happened to, check out that project's file.