# Extensions as submodules - one more time

**URL:** <https://www.ruby-forum.com/t/extensions-as-submodules-one-more-time/156692>\
**Category:** Radiant CMS\
**Created:** [January 1, 2009, 5:54am UTC](https://www.ruby-forum.com/t/extensions-as-submodules-one-more-time/156692 "2009-01-01T05:54:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [January 1, 2009, 5:54am UTC](https://www.ruby-forum.com/t/extensions-as-submodules-one-more-time/156692/1 "2009-01-01T05:54:54Z")

</div>

Andrew was kind enough to document for me how to use a local branch of a  
git-cloned extension in a project. Sean was kind enough to explain how  
to  
set up extensions as submodules in a git-managed project. I have one  
more  
question related to git, submodules and extensions. Is it possible to  
create  
and use a local branch of an extension when it is included as a  
submodule? I  
just want to ask before I start on something that isn’t possible (or the  
correct way to do things).

Thanks,

Nate

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [January 3, 2009, 7:50pm UTC](https://www.ruby-forum.com/t/extensions-as-submodules-one-more-time/156692/2 "2009-01-03T19:50:06Z")

</div>

On Wed, Dec 31, 2008 at 10:54 PM, Nate T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Andrew was kind enough to document for me how to use a local branch of a  
> git-cloned extension in a project. Sean was kind enough to explain how to  
> set up extensions as submodules in a git-managed project. I have one more  
> question related to git, submodules and extensions. Is it possible to create  
> and use a local branch of an extension when it is included as a submodule? I  
> just want to ask before I start on something that isn’t possible (or the  
> correct way to do things).

I just want to add that I found an answer for my question here just in  
case  
anyone wants to know or needs to know.

If you add your extensions as git submodules and you want to use an  
earlier  
commit of that extension, what you have to do is set up a run line in  
the  
after\_deploy area of your deploy.rb file. For instance, your project is  
managed using git, you are using Radiant 0.6.9 and you want to use the  
page\_attachments extension. Well, the page\_attachements extension broke  
compatibility with 0.6.9 a few commits back, so you would have to put  
something similar to this in your after\_deploy task in your Capistrano  
deployment recipe:

run “cd  
~/[name\_of\_your\_application\_on\_server]/current/vendor/extensions/page\_attachments;git  
checkout f07ba4;cd …/…/…;git add .”

1. This will git checkout commit f07ba4, which is the last version of  
page\_attchments that works with Radiant 0.6.9.
2. cd to the root of your project.
3. git add the changed file (.gitmodules) to your project so that it  
will  
use the new (old) version

When I started out with git on this project I was a git virgin so there  
might be a better/easier way to do this, but after many rounds with tech  
support at Rails Playground and many (many, many) google searches and  
the  
git book from Pragmatic, this is what I used to make use of previous  
commits  
of the page\_attachments and copy\_move extensions.

FYI, I used commit SHAs to reference the versions I used because the  
extension creators, both of them, failed to tag their extensions for  
pre-0.7  
versions of Radiant. Thanks, guys.

When things slow down for me, probably February, I will be contributing  
some  
of my processes on this and some of the other “workarounds” I have made  
to  
get projects working correctly using Radiant with available extensions.  
Some  
of that will cover git info for noobs (like I was), the template  
extension,  
subscriber lists and probably something on mailer. So I am in for the  
“Spring Continuum” ongoing documentation project.

Cheers,

Nate
