Assuming I have only a master branch with commits
A (initial) --> B --> C --> D --> E (head, newest)
on my PC and in a private repository on GitHub.
Now I want to publish it, but commits A and B (the oldest) are containing hardcoded keys/passwords (I know that's bad practice, this was only a quick test).
Is it possible to clone the repo (on my PC) and push this version to a separate public origin only with commits C (now initial) --> D --> E
?
So I still want the private unmodified/complete repo and another pruned one as a public version.
Which commands should I use if this is even possible?