As I recently tried to push my commits to github, I got the same error message as in this question. I removed the files from my repository but now have to clean up the history. As advised in the answers I looked into BFG, which seems to be the solution. While reading through the instructions it starts with using git --mirror link-to-remote-repo
.
Now I am wondering, because I couldn't push the newest commit yet and probably my local commit history is longer than the one on github. Furthermore I am unsure as all the work I did is on a branch and not on master and how it affects my repository.