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.
You should just be able to navigate to the plugin's directory and hit:
git pull
. I'm pretty sure that script/install plugin
just checks the code out from the git repo.
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
In order for Git to be able to recognise the repository as a Git repository, you will need to add the .git
subdirectory and everything under it to Subversion as well. Otherwise, the plugin will just look like another pile of source code and Git will say it's "Not a Git repository".
Anyone have a definite solution to this or could someone please explain more about the .git subdirectory requirement?
I have the Paperclip plugin for Rails and I'd like to update it without screwing up my working copy, which happens when I run "script/plugin install --force".
Ran into the same situation and used this solution: had paperclip installed as a plugin sitting in an svn repo as part of my app. Now I wanted to use the latest version instead and didnt change a bit of the paperclip plugin so I could easyly remove it from the app/svn and install it as a gem instead. done.
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.