Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update rails plugins installed through git but in a svn repo?

My rails app is in a svn repository, but several of the plugins are installed through git and later added to the svn repo. How can I update these plugins? I can't seem to get script/plugin update to do anything. I'd really like to update activemerchant to get rid of the Inflector warnings.

like image 232
jcoby Avatar asked Jun 01 '26 03:06

jcoby


2 Answers

If you haven't made any local changes to the plugin and you don't need to track what changes to it the update will bring, you can just run script/plugin install again, passing in --force if you need to. For example:

script/plugin install --force git://github.com/dchelimsky/rspec.git
like image 199
Matt Avatar answered Jun 04 '26 00:06

Matt


If you already have a static copy of a plugin checked into Subversion, it can be a pain to update it via script/plugin, so here's what I end up doing in order to switch it from a static install to a Git checkout all within one Subversion commit:

git clone git://github.com/foo/bar.git ~/foobar
mv ~/foobar/.git rails_app/vendor/plugins/foobar/.git
rm -rf ~/foobar
cd rails_app/vendor/plugins
git reset --hard

Then make sure to add .git and everything else that has changed to the Subversion project and you will be all up-to-date. You can use other git commands to pull down updates, move to a different branch, etc. Then just check things in again once they are at the state that you want.

like image 32
Grant Hutchins Avatar answered Jun 04 '26 00:06

Grant Hutchins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!