# Another git question with regards to extensions

**URL:** <https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639>\
**Category:** Radiant CMS\
**Created:** [December 31, 2008, 7:35am UTC](https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639 "2008-12-31T07:35:21Z")\
**Posts on this page:** 7\
**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:** [December 31, 2008, 7:35am UTC](https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639/1 "2008-12-31T07:35:21Z")

</div>

I am trying to get a handle on git and am having some difficulty  
understanding how to manage my projects. My project was built outside of  
version control where my extensions used were all git-cloned into my  
project. Two of the extensions (page\_attachments and copy\_move) are  
using  
previous revisions set up as local branches. The project directory was  
then  
initialized as a local git repo and the remote.upload.url variable was  
set  
up. I can ‘git push upload master’ to my online git server at Rails  
Playground. It all seems to work properly, but if I try and git-clone my  
project to test if it’s working, none of the extensions have any files  
in  
the vendor/extensions/extensionX directories.

In the past when I was using subversion to manage my projects a  
git-cloned  
extension maintained its content. How should I be adding extensions to  
my  
project so that travel with the project?

~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:** [December 31, 2008, 1:45pm UTC](https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639/2 "2008-12-31T13:45:01Z")

</div>

The typical method is with `git submodule`. So if I were to install  
page\_attachments manually, it would be like so:

$ git submodule add  
git://github.com/radiant/radiant-page-attachments-extension.git  
vendor/extensions/page\_attachments  
$ git submodule init && git submodule update

You’ll likely need to remove the original extension installation before  
you use submodules. Once it’s installed correctly as a submodule, you  
can use pull/reset within the extension directory to put it on the  
revision that you prefer to use, then commit to the main project to lock  
in that revision.

Sean

---

<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:** [December 31, 2008, 6:37pm UTC](https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639/3 "2008-12-31T18:37:08Z")

</div>

On Wed, Dec 31, 2008 at 7:25 AM, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> One thing I forgot to mention. Whenever you clone the project again, you  
> need to run:
> 
> $ git submodule init && git submodule update
> 
> This will make sure you download the submodules.

Thanks for your help Sean. Now I have another related question. I am  
using  
the subscriber\_lists extension but on my copy I changed a couple of  
things.  
Since I cannot use submodule to include the extension, how can I tell  
git  
ignore the fact that it was a cloned copy of the one on github? Or,  
barring  
that, how can I download a copy of the code from github (think svn  
export)  
to make the changes and track the code in my own repo?

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:** [December 31, 2008, 2:26pm UTC](https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639/4 "2008-12-31T14:26:20Z")

</div>

One thing I forgot to mention. Whenever you clone the project again,  
you need to run:

$ git submodule init && git submodule update

This will make sure you download the submodules.

Sean

---

<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:** [December 31, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639/5 "2008-12-31T18:46:31Z")

</div>

I would suggest forking on github, pushing up your changes to your fork,  
and then creating the submodule from the fork. If you don’t want to  
track other branches/forks but just keep your changes in the Radiant  
project, just clone the extension (not as a submodule) and then remove  
its .git directory.

Sean

---

<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:** [December 31, 2008, 6:59pm UTC](https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639/6 "2008-12-31T18:59:58Z")

</div>

On Wed, Dec 31, 2008 at 11:45 AM, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I would suggest forking on github, pushing up your changes to your fork,  
> and then creating the submodule from the fork. If you don’t want to track  
> other branches/forks but just keep your changes in the Radiant project, just  
> clone the extension (not as a submodule) and then remove its .git directory.

Thanks. I am really not feeling the git love right now so I am going to  
try  
and avoid adding more complexity to my situation by starting a fork. I  
did  
remove the .got directory from my locally cloned copy of the  
subscriber\_lists extension, but when I run git submodule I keep getting  
this  
error:

No submodule mapping found in .gitmodules for path  
‘vendor/extensions/subscriber\_lists’

Preceding the error, I git a list of the extensions that I have set up  
as  
submodules and there is one (tags) that should show up as a submodule as  
well, but nothing gets past this error.

To remove the .git directory did an ‘rm -rf’ to remove it and a ‘git rm’  
just to make sure it was out of git.

Any ideas?

~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:** [December 31, 2008, 9:09pm UTC](https://www.ruby-forum.com/t/another-git-question-with-regards-to-extensions/156639/7 "2008-12-31T21:09:52Z")

</div>

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

> and avoid adding more complexity to my situation by starting a fork. I did  
> remove the .got directory from my locally cloned copy of the  
> subscriber\_lists extension, but when I run git submodule I keep getting this  
> error:
> 
> No submodule mapping found in .gitmodules for path  
> ‘vendor/extensions/subscriber\_lists’

Nevermind. I hadn’t done a ‘git add .’ and commit to add the files to  
the  
repo. It’s working now.

Thanks,

Nate
