there are similar questions here in stackoverflow, but none is exactly what I’m going to ask, at least none I could find.
I’m starting an OSS project, and I want to share it publicly on github. But I also want to have a private remote repo in a server of mine. The public repo is for the public version of the project, and the private repo is for an internal version, not ready for release. Obviously the public repo will always be a possibly old version of what’s in the private, and stuff in the private will not be pushed to public until they’re ready.
I searched over the net and I found some guys who came up with a workflow very similar to what I want. This is the link to the blog post where they explain everything: http://www.braintreepayments.com/devblog/our-git-workflow
I like everything about it, except for the totally squashed commits that go into the public repo on github. I also dislike a bit the part where, after merging into public, they have to re-merge everything back into master and release branches, even though, as they positively assert, there are no real changes to make there.
My question is, is it really bad to have a public repo history that’s just a series of squashed commits that has lost all the details of the logical changes within it? It seems unnatural to me and I have not seen this a lot, but maybe it’s not that bad, or else I can adopt this workflow without the --squash parameter.
Also, what about the phase of re-merging back from github_master to the master and release branches? I guess they need it because of the squashed commits. If I decide to not squash, then I think this is not needed, but I’m not sure.
Or else, can anyone suggest a different way to do this? Take into account that I would also possibly want to accept contributions from other people if someone forks my github repo.
If you simply don’t want the unreleased changes visible until they’re released, and don’t mind the intermediate commits becoming visible once they are released, then this is fairly simple. You can just treat your private branch as … well, an ordinary branch. Just make sure the private branch name doesn’t exist on github (but does exist in the private repo), and the default push settings should take care of things.
If you do want to hide history, though, well, that’s what that squash-based workflow is all about. In this case, if you do merge external branches, it would be best to avoid squashing their commits.