# Using Git with Radiant Extensions

**URL:** <https://www.ruby-forum.com/t/using-git-with-radiant-extensions/151127>\
**Category:** Radiant CMS\
**Created:** [October 17, 2008, 7:08am UTC](https://www.ruby-forum.com/t/using-git-with-radiant-extensions/151127 "2008-10-17T07:08:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [October 17, 2008, 7:08am UTC](https://www.ruby-forum.com/t/using-git-with-radiant-extensions/151127/1 "2008-10-17T07:08:22Z")

</div>

Trying to get up to speed with a Git workflow and I have some questions  
about working with extensions.

If I have a radiant project A that uses someone else’s extensions B, C,  
and D. I understand that I can create a repo for radiant project A set  
up all the extensions as submodules (if they’re all in git repos).

If, on the other hand, I’m developing extension B, I could set up a  
dummy project A (no repo), and set up B, C, and D as independent,  
parallel repos. No submodules. With B being the one I’m working on,  
managing, branching, etc. of course.

But what if I’m developing extension B along with project A? If you  
edit code within a submodule B, there’s no way to send those changes  
back to the original B repo (or use branching, or other git tools) on B  
is there? Git isn’t really tracking your changes on B is it?

Is there some way to handle this development situation or am I just  
going about this wrong?

Is piston or braid an option here and if so, is anyone using it  
successfully?

Thanks,

-Chris P.

---

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [October 17, 2008, 2:49pm UTC](https://www.ruby-forum.com/t/using-git-with-radiant-extensions/151127/2 "2008-10-17T14:49:11Z")

</div>

Like svn:externals, you can maintain a submodule in a project, commit to  
it and push it while maintaining the parent project. However, whenever  
you’ve changed something in the submodule, it’s necessary to go back up  
to the parent project, commit the submodule directory, and possibly do  
`git submodule init` and `git submodule update` (I don’t know if that’s  
strictly necessary, but I like to do it to be certain). That will make  
sure that the next time your parent project is checked out, it will get  
the latest submodule version.

Sean

---

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [October 17, 2008, 5:04pm UTC](https://www.ruby-forum.com/t/using-git-with-radiant-extensions/151127/3 "2008-10-17T17:04:12Z")

</div>

So, to make sure I understand…

If I have an extension of mine in a submodule of a project, I can  
develop within that extension:

```
* make changes in that copy of the extension (testing its behavior
  as part of the project)
* commit those changes to the submodule's repo
* manage branching (gitk, etc) from within that submodule

```

If so, that helps me a lot. Everything I’d read made it sound like  
submodules don’t behave like a working git repo which is why I thought  
you couldn’t push changes back to the original – that submodules only  
permitted data transfer one-way (from source to your local copy).

-Chris

---

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [October 17, 2008, 6:52pm UTC](https://www.ruby-forum.com/t/using-git-with-radiant-extensions/151127/4 "2008-10-17T18:52:46Z")

</div>

Chris,

You may want to have a look at the ray extension. It enables you to  
manage your extension also as git submodules. I just discovered this  
extension and enhanced my fork to accept a ‘remote’ variable either on  
the command line or within the bundles extensions.yml (to install a  
bunch of extension), so you can add git remotes automatically with the  
installation of the extension. There is also a new rake task ray:pull  
that pulls all remote sources to the submodule. This comes handy when  
you’re developing an extension that you have forked.

Michi

---

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [October 18, 2008, 10:36pm UTC](https://www.ruby-forum.com/t/using-git-with-radiant-extensions/151127/5 "2008-10-18T22:36:43Z")

</div>

On Oct 17, 2008, at 11:28 PM, Chris P. wrote:

> > > data transfer one-way (from source to your local copy).  
> > > develop, commit, and push from the master project (the Radiant  
> > > the project’s repo and ‘git submodule update’ as Sean mentioned.  
> > > there (apart from the Radiant project), then go back to my project  
> > > and update those changes into my submodule?
> 
> I guess the question is “is a submodule (the copy checked out into  
> my project) a full-fledged git repo that you can branch, change, etc  
> (all from within the project)?”

Yes. Just “cd vendor/extensions/whatever” and do your git stuff there,  
commit those changes from there to that repo, then “cd …/…/…” and  
commit the altered submodule. I’m no pro with git, but I’m relatively  
confident that’ll do it.

-Jim
