# How does one specify plugin versions under git?

**URL:** <https://www.ruby-forum.com/t/how-does-one-specify-plugin-versions-under-git/136641>\
**Category:** Rails\
**Created:** [May 5, 2008, 2:09am UTC](https://www.ruby-forum.com/t/how-does-one-specify-plugin-versions-under-git/136641 "2008-05-05T02:09:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 5, 2008, 2:09am UTC](https://www.ruby-forum.com/t/how-does-one-specify-plugin-versions-under-git/136641/1 "2008-05-05T02:09:09Z")

</div>

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 [http://svn.jcoglan.com/packr/tags/1.0.2/packr](http://svn.jcoglan.com/packr/tags/1.0.2/packr)

but with git all I’ve seen is

script/plugin install git://github.com/jcoglan/packr.git

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 5, 2008, 3:19am UTC](https://www.ruby-forum.com/t/how-does-one-specify-plugin-versions-under-git/136641/2 "2008-05-05T03:19:54Z")

</div>

On Sun, May 4, 2008 at 8:08 PM, removed\_email\_address@domain.invalid  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> and still need to do some work on Windows.)  
> 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://github.com/jcoglan/packr.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.

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 6, 2008, 11:46am UTC](https://www.ruby-forum.com/t/how-does-one-specify-plugin-versions-under-git/136641/3 "2008-05-06T11:46:35Z")

</div>

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 C.

Rick Denatale wrote:

> On Sun, May 4, 2008 at 8:08 PM, removed\_email\_address@domain.invalid  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > and still need to do some work on Windows.)  
> > 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://github.com/jcoglan/packr.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.
> 
> –  
> Rick DeNatale
> 
> My blog on Ruby  
> [http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 9, 2008, 2:30am UTC](https://www.ruby-forum.com/t/how-does-one-specify-plugin-versions-under-git/136641/4 "2008-10-09T02:30:23Z")

</div>

Are there any simple instructions for installing a plugin hosted on  
github?

./script/plugin install git://github.com/latimes/craken.git

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 7, 2008, 3:39pm UTC](https://www.ruby-forum.com/t/how-does-one-specify-plugin-versions-under-git/136641/5 "2008-05-07T15:39:41Z")

</div>

On Tue, May 6, 2008 at 5:46 AM, Juanma C.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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.

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.

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
