Recommended workflow for public and private forks of a public GIT-SVN-created repo
I'm trying to set up three things:
- a public GIT mirror of a public SVN repo
- a pubilc fork of that repo where multiple contributors can stage patches
- a private fork of the public repo from #2
I know how to do #1 but am looking for advice on #2 and #3: how to configure, how to keep in sync, things to avoid, etc.
Here's more details:
I'm working with an SVN-based open-source web application whose patch-submitting mechanism is slow and inefficient: patches are attached to bugs submitted in an issue-tracking system, and weeks or months later those patches make it into the trunk.
A seprate problem is that I need to maintain a private fork of the project with additional features that only my company will need. But I want an easy way for my fork to stay up to date with the latest official commits from the trunk.
I'd like to figure out a GitHub-based solution to both these problems. I'd like to end up with three things:
- "mirror" - GitHub mirror of SVN, automatically kept in sync with the latest SVN changes via an automated process (like in this article) that I or another patch-contributor will run. This will make it easy for me or anyone else to create a public or private fork of the project without messing around with SVN.
- "contrib" - for myself and a few patch submitters I trust, I'd like to set up a public fork (or branch?) of "mirror" where we can commit patches we'd like to see eventually show up in SVN. This may also make it easier and more efficient for the core committers to pull patches back into SVN.
- "ourfork" - finally, our company wants ot set up a private fork of "contrib" where multiple devs can add private features which only apply to our company's implementation
Some specifc questions:
- does the approach make sense? Is there a simpler solution we should be using instead?
- how to ensure that "contrib" is kept in sync with "mirror"? Is there GitHub magic to automatically apply new commits as long as they don't conflict? Assuming no, what's a good workflow to ensure contrib stays in sync with its parent?
- "ourfork" will logically be a grandchild of "mirror". What's the right workflow to keep it up to date with changes from both "mirror" and "contrib"? Should I set up "contrib" as my only remote? Or set up both as remotes-- and if so what's the right process for merging?
I read @rq's answer to a similar question and I suspect it answers most of the 开发者_如何学运维questions above, but I'm a Git newbie and I'm not sure if his answer applies to my case.
I would recommend that you have a look at SubGit. It’s a tool to create and keep in sync a Git repository linked to an SVN repository. It has advantages over other solutions like:
- concurrently safe commits (so if one of contributor commits into Git and another one into SVN within the same millisecond, nothing bad will happen: if their changes conflict, one of them will just get an “out-of-date” error)
- better SVN↔Git concepts translation like ignores, EOLs, arbitrary branches (not only master) and tags and so on.
But there’s a restriction: you should have an access to the SVN server, so maybe your GitHub-based solution won’t work. But you can have a look at GitHub replacements like GitLab, Luna-tool and others (Git Server Like GitHub?).
I can't give a complete answer, as your setup is quite demanding.
I would perhaps try to get one of the SVN committers on board. I would then set him in charge of rebasing feature branches in on top of the git-svn clone, and then dcommitting changes back to Subversion. I recently did a very simple example of this workflow in a screencast.
This does require a very tight feedback loop with one of the SVN committers though, and in order to keep history linear, you would have to do a lot of rebasing, which again makes it hard to keep distributed repositories in sync. I'm not sure this will work out for you.
精彩评论