I use Versions on OS X to manage all my code in Subversion. I’m not interested in significantly changing my current workflow until Git has a great GUI app like Versions.
One of my clients wants me to push my code to a private GitHub repository. There are many questions and articles about running Git locally and pushing to a remote Subversion server, but I can’t seem to find any suggestions for the opposite scenario.
To be clear, what I want to do is:
- Keep my code managed in a local Subversion checkout (the central repository is actually on a remote server, but I’m hoping that doesn’t matter here)
- Whenever I make a delivery to the client, I’d like to run a command such as “git update-github-with-local-svn-changes”
- If someone else commits to GitHub (rare), I’d like to run a command such as “git update-local-svn-with-github-changes”
The best answer I can think of is to use
git-svnto make a git copy of your subversion server, then push the branch thus created to github. When changes are made in github, pull them down, merge them with your branch cloned from subversion and commit them into subversion. This is treating the whole github side of things as a downstream from your (master) subversion server, and you should be able to use all the suggestions already out there for managing it.If there is already code in github, you may have to do a bit of dancing with rebasing. The basic idea would be to get the latest source, import it into subversion, pull from subversion using git-svn then rebase the latest git-svn commit on top of the branch from github. You then have the git history with a new commit at the head, containing git-svn metadata. I’ve not tried this, though.