I've been working on a project locally for some time, and it's finally at the point that I'd like to upload it to GitHub to share. Early versions of the project contained hard-coded database passwords that I'd like to avoid putting on GitHub, though.
Is there a way for me to push a "shallow" version of the repo -- just the files as they are now, without history -- to GitHub? Something like git clone --depth 1
would be nice, except it seems like you can't "push clone" from localhost to GitHub, and GitHub doesn't seem to have an interface that lets me "pull clone" in the normal way.
I've spent a couple of hours doing web searches for "git push to github without history", "git push to github as shallow clone", "git push clone to github", etc., but nothing comes up that I can decipher as relevant to my problem. The GitHub docs for this warn against committing passwords and things, but the only advice they give is to remove files, not history. Similarly, the closest question I can find on Stack Overflow is this question whose answers also focus on deleting files. I don't want this: I want to keep the files, I just want to remove the history that they once contained hard-coded passwords.
Ideally, I would be able to "shallow push" the project from localhost to GitHub, losing previous history but tracking history from that point forward. Is this possible?