What is the best way to set up a git repo for a project that your company uses internally, but you also want to open-source (but with a potentially modified history)?
Let's say Acme company has a repo "supercoolproject". They want to open source it, but they don't actually want the company name associated with it at all. They set up a GitHub account under one of their developer's names (or a group, etc), and create the repo. They clone this to an internal Acme server. Nowhere is "Acme" mentioned.
Now comes the problem - in any given organization there are developers who understand open source and are authorized to push some code public. There are others who don't understand all the nuances. When one of these makes a commit, perhaps they include the company name or some other proprietary information. Or, they just make a horrible commit that can be reverted internally (not rewriting history - I'm just talking about adding a "revert" commit). But, you don't want those proprietary commits going out into the open source branches.
So, you create "acme_internal_{dev,qa,production}" branches, and an external "master" branch (and maybe others). What's the best way to keep those in sync? You want to accept commits on the open source repos. And you want to push (most of) your internal commits out. But there are some that shouldn't go out.
It seems that merging internal -> external is a bad thing because you can't remove the bad commits. Rebasing the external branches on the internal ones could be done, but it seems that as soon as you "git rebase -i acme/acme_internal_dev" one time and modify history (change commit messages, remove commits, etc) you can no longer rebase because the two histories diverge. So, do you end up cherry-picking all internal commits out to the public branch and then merging the public branch into the internal tree? That seems ugly too because you end up with duplicated commits internally (the original, and then the cherry-picked one that went into the external and was merged back into the internal).
For the purpose of this question, let's assume that internally Acme wants to avoid rewriting history (actually removing/modifying the bad commmits) on their internal branches.