I would like to maintain two forks of a project: one for internal use at the company and another one for opensource. I’d like to have all deploy-specific elements in the source tree (like the deployment recipe and the database configuration and a version-specific bootstrap file and so on).
The way I envisioned it was that i’d have two branches, for example master and internal. In that case one thing I’d like to prevent is pushing the internal branch to Github since that would contain sensitive information. I’d then cherry-pick changes from the internal branch into master.
So how do I configure remotes that a branch is pushed to it’s default remote? I have to setup that branch to track another remote than Github?
Or is there a better workflow to developing two forks in lockstep for this kind of situation?
Once someone has cloned your repo, he (or she of course) has full access to all branches stored in the repo. You cannot prevent him (or her of course) from pushing the complete repo to somewhere or even make the sources public on the internet.
If you want to keep secret things secret, set up two repos, one for
masterand one forinternaland thencherry-pickthe needed commits frominternaltomasterlike you intended to do.To achieve this, add the
internalrepo as remote to themasterrepo. While being onmasterdoWhen you want to take commits from
internaltomaster, simplyfetchthe latest revisions ofinternalintomasterthen check the commits to be taken and
cherry-pickthem using