Read about:

Posts Tagged ‘git’

GitHub Project Watch – 09/07/08

(Programming)

I’ve decided to create a new series of posts called “GitHub Project Watch” to highlight some of the projects on GitHub that I am watching. It’s kind of like GitHub Rebase, but with my own personal touch.

Here are some of the projects that I’m watching this week:

  • jmettraux/ruote: an open source workflow engine built with Ruby. I might be using this for a project I’m working on. Also see jmettraux/ruote-web2 for a demonstration of how to integrate ruote with Ruby on Rails.
  • brynary/webrat: automated acceptance testing with Ruby. It can simulate a simple browser on its own or drive a real browser via Selenium. Apparently there’s some work in progress on integrating with Watir and Celerity as well.
  • radiant/radiant: RadiantCMS, the lightweight web content management system for Ruby on Rails. I’m contributing a Japanese translation, the current version of which is currently available in the official i18n branch. (also see kbingman/radiant and enricob/radiant)
  • chriseppstein/compass: As I wrote previously, Compass is gaining new features at an incredible rate. It now sports improved Rails integration, Blueprint 0.9, an extension system, and asset hosts support. As an added bonus, it no longer depends on edge Haml; it will work with the newest stable release of Haml, 2.2.0. This is one of the most watched repositories on GitHub for a reason — if you’re not already using this, try it today!

I’m sure that I will hear of even more awesome projects at Future Ruby.

From Git to SVN

(Programming)

There are many blog posts that talk about how to import a Subversion repository into Git but there isn’t much out there on how to work the opposite way.  After a bit of trial and error, I managed to figure out how to bring a Git repository into SVN and continue “pushing” updates from Git to SVN.

This might raise some questions for fervent Git fans: Why would anyone want to do this? Why not just keep everything in Git?

Here’s a personal anecdote: I developed a plugin for WordPress called GitPress. My initial development was done on GitHub, but in order for my plugin to be available via the WordPress Plugins Directory, I needed to bring everything from GitHub into WordPress’ SVN repository.  Here’s how I did it:

First, we create the initial SVN remote.  By using the standard layout (--stdlayout) and specifying the “gitpress/” prefix, I can easily get tracking branches for SVN branches, tags, and trunk.

git svn init --stdlayout --prefix=gitpress/ --username=enricob http://svn.wp-plugins.org/gitpress

Now, I fetch everything from the SVN remote that I’ve created and see if the remote branches are there:

git svn fetch

Now, when I list my remote branches in Git, I see gitpress/trunk, gitpress/tags, and gitpress/branches.  I create a local tracking branch for gitpress/trunk, which is where I’ll be pushing my changes:

git checkout -b svn-trunk gitpress/trunk

Now that I’m in my new tracking branch, I bring in the changes from my Git repository’s master branch:

git merge -s subtree master

Finally, I can commit my changes to SVN in one squashed commit:

git svn dcommit

I’ve also found that using git svn rebase causes separate commits to be made instead of getting a squashed commit, but the cases I’ve run into are pretty simple so far.

So that’s how I brought my GitHub project into an SVN repository. Hopefully this will help somebody else who might run into the same situation.