Background: I'm migrating a commercial piece of software to open source. This is currently a hypothetical case, but it might become real if I make a mistake.
Suppose I have inadvertently incorporated some commercial copyrighted material into my open source repository (e.g. some graphics). The copyright owner has issued me a cease-and-desist notice. Because this is a commercial matter I must remove the material completely; nothing less will do. I could of course remove the infringement in HEAD, but that leaves the infringing material in the Git history on GitHub.
Short of deleting the entire repository and creating a new one from scratch with the current HEAD, is there any way I can expunge the offending file from GitHub?
There is also the side effect that doing so will break historical builds that would otherwise have worked, but them's the breaks.
I've read "Handling copyright infringement in your own open source project" but the answers don't address the git history.
Update
I've now found git filter-repo
, which is preferred to git filter-branch
and is a large part of the answer. But how do I push the resulting change to my GitHub central repository? Or should I just delete the entire GitHub repository and create a new one from my munged local copy?