Problem:
Accidentally commited a large file, and it wasn't the most recent commit, so now I have to dig it out of my history (because of GitHub file size limitations) in order to push my commits to GitHub. Meaning I have a local copy of my repo which I need to edit the history of.
Tried Solution:
BFG seems to be the universally recommended solution to this problem (even GitHub recommends it). So I downloaded BFG and followed the steps (here: https://rtyley.github.io/bfg-repo-cleaner/).
The only obvious alteration to the steps listed there is that I ran git clone --mirror...
pointing to my local git repo, instead of a github url. This is because the history that needs to be changed exists only on my local machine (GitHub wont let me push it, after all).
But because of this alteration, when I get to the last step in the BFG instructions, git push
, it is actually trying to push to my local directory. And apparently this doesn't work.
git push
(ran in the mirror of my local repo that I made per the BFG instructions) fails with the error message "branch is currently checked out".
I have not been able to find any obvious solution, all of the instructions for BFG seem to assume that you will be cloning from a remote server.