Rails, Git, and Plugins

Posted by Matt on May 12, 2008

One of Rails’ greatest strengths lies with the plugin system. Git is the new source control kid on the block that all the girls are talking about, but Git breaks existing systems to manage plugins, such as Piston and the great ’./script/plugin install -x’ command.

Git giveth and Git taketh away.

Git has the supernatural ability to track submodules in your application. The below command adds RESTful_ACL as a submodule to your application inside the vendor/plugins directory, checks the project out for you, and commits changes in your application (added info in .gitmodules).


git submodule add git://github.com/mdarby/restful_acl.git vendor/plugins/restful_acl
	

git commit -a

When you go to clone to a different machine, just run the following two commands to checkout all of your submodules:


git submodule init
git submodule update

You’re off and running!