How does one specify plugin versions under git?

Hi all,

I'm looking to migrate all my plugins to git in the near future, just
got a couple of questions I've not been able to find answers to:

First, will users need git installed in order to install git-hosted
plugins? How long does Rails plan to maintain svn for freezing to
edge? Has anyone had issues installing git-managed plugins under
Windows? (I'm also in the process of migrating from Windows to Ubuntu
and still need to do some work on Windows.)

Second, how do you specify versions to install? With svn, I can tell
people to

script/plugin install

but with git all I've seen is

script/plugin install git://

Is there any way of installing a specific branch or tag, without
cloning the project yourself and extracting the version you want?

It looks like script/plugin install git://..../foo.git clones the
plugin's git repository into vendor/plugins/foo.

Remember that git works by putting the complete history on each
machine. git clone fetches the entire repository, and then checks out
the latest branch.

So you can actually get any version after you install the plugin, just
check it out.

$script/plugin install git://
$cd plugin/install/packr
$git co version-x

Assuming that the plugin has tagged versions. packr doesn't seem to.

Of course you can get any commit version as long as you know how to
name it, even if the name is a (partial) sha-1 value.

This it is not working for me.

It seems that I only get source files from the main branch and not the
complete git repository cloned.

Juanma Cervera

Rick Denatale wrote:

You might not be seeing it, it should be in the .git directory in the
directory for the plugin.

Git works differently than SVN, you don't checkout a version from a
remote repository, the working directory is a view of your local
repository which changes when you checkout a branch.

git clone which is the command which the plugin script uses (at least
the version of the source code I looked at does) makes a local copy of
the entire remote repository in the .git directory of the target, and
then checks out the master branch to the working directory.

Peepcode recently released a new pdf on git which starts with a
description of how git actually works and not from the usual
perspective of git for svn/cvs... users. Well worth the $9 IMHO.

Are there any simple instructions for installing a plugin hosted on

./script/plugin install git://

This doesn't seem to work for me, as I'm using svn locally.