I'm attempting to manage an open source project on GitHub with a hybrid public/private workflow similar to the one described here: https://stackoverflow.com/a/30352360/204023
Essentially this describes a process where there are two repositories which mirror each other, without GitHub's fork
relationship. This allows you to use standard git remote repositories to push/pull changes between branches, and public GitHub pull requests to merge private changes into the master branch. Exactly what I'm trying to accomplish.
I have one extra requirement where I would like to truncate the PUBLIC commit history in case it contains sensitive data, while maintaining the PRIVATE commit history.
Initialize the new project with --depth 1
turns out to be illegal, you can't initialize a new repo with a shallow clone: ! [remote rejected] master -> master (shallow update not allowed)
The solutions I've found for truncating the commit history involve creating a brand new repository, but with a new copy of the repo I can no longer push/pull between public/private copies.