What! What?

Wal McConnell

Git Submodules

Working with work-in-progress rails plugins can be a right pain. Especially if you need to upgrade them often.

I've started to install plugins in my rails apps as git submodules, this allows me to upgrade them easily, and also win the power of git for manipulating them. This is especially useful for making patches, and developing plugins

Adding submodules is easy. Instead of the usual

script/plugin install ... 
stuff, use


git submodule add GIT-URL-OF-PLUGIN ./vendor/plugins/PLUGIN-NAME

e.g


git submodule add git@github.com:contrast/exceptional.git ./vendor/plugins/exceptional

** Warning ** Installing a plugin this way will not fire its initialization. So you might need to run the init.rb for your plugin manually

Now you can cd into that plugin folder, and use all its git commands as if it was an isolated git repo