a really easy migration to github from subversion

Yep, I’m trying to git on the bandwagon too. Last fall I dropped a small set of plugin files into github as a test, which was easy enough. But never had the time to figure out how to get all the other plugins, libraries and frameworks we use in there without moving everything over, including all the client project code.

So in the last few months I have been making commits via svn as usual, ignoring the old github account entirely. It was pretty simple to get all those interim svn commits into github though, here’s how:

  1. Checkout a new working dir from subversion and initialize a new git local repo at the same time with git-svn:
    $ git svn init [url://to/svn/repo]
  2. in the new dir, add the github remote repo info to the end of .git/config
    [remote "origin"]
    url = git@github.com:[gitusername]/[reponame].git
    fetch = +refs/heads/*:refs/remotes/github/*
    push = refs/heads/*:refs/heads/*
  3. do a $ git push

Then, in this local git repository it seems that the incantations

$ git-svn fetch
$ git-svn dcommit
$ git push

will download any and all changes from the original svn repo, and commit them to git and then push them to the remote git repo, which happens to be github.

The question remains, though, how to use github for these plugins, applications and other re-usable public code, while keeping the surrounding private client files in svn (where they need to be for historical reasons). One way might be to just have subversion ignore them and use fsniper to do a git-svn fetch on the appropriate dirs when subversion is updated (and yes I am just thinking out loud here).

Write a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Essentials

A service of Onset Corps LLC, and your humble author and fellow journeyer Samuel Beam.

Wherein, we specialize in over-involved explanations of all types, especially as concerning the efficacious use of tools and processes to maintain simplicity in an irreducibly complex world.

Meta

Pages

Categories