August 11th 2008

“Rails and git submodules can play nice”

I use git submodules to track plugins that I have under active development. This way, I can make changes to the main repository as well as the plugins with minimum fuss. There’s a great tutorial on working with submodules, which includes a couple of gotchas that may explain why submodules have got such a bad rep from some quarters.

Gotcha No. 1 - Always commit changes in your submodules before commiting your main repository

If you make any changes to a submodule, be sure to commit and publish these changes before you commit anything in the main repository, otherwise you and others will have issues trying to clone the repository.

Gotcha No 2 - Check you’re on a branch before making changes

If you are cloning a repo with a submodule and run git submodule init/update, be aware that the submodule has been checked out at a specific commit as apposed to the head of a branch meaning you have to checkout a branch before you make any changes.

ink stain comments

“One Comment”

Mike Kalioupis Said:

Programming Ruby, The Pragmatic Programmer’s Guide - Αυτό είναι ένα από τα καλύτερα
δωρεάν e-books που κυκλοφορούν για τη Ruby. Η πρώτη έκδοση αυτού του βιβλίου διατίθεται on-line. Μια κόπια αυτού του βιβλίου επίσης περιλαμβάνεται στο αρχείο της Ruby όταν την κατεβάσετε. Θα πρότεινα αυτό το βιβλίο ως το πρώτο βιβλίο για την εκμάθηση της Ruby.

November 11th, 2008

Leave a Reply