# Git Subprojects and Rubyforge

**URL:** <https://www.ruby-forum.com/t/git-subprojects-and-rubyforge/173880>\
**Category:** Ruby\
**Created:** [August 17, 2009, 4:49pm UTC](https://www.ruby-forum.com/t/git-subprojects-and-rubyforge/173880 "2009-08-17T16:49:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 17, 2009, 4:49pm UTC](https://www.ruby-forum.com/t/git-subprojects-and-rubyforge/173880/1 "2009-08-17T16:49:44Z")

</div>

I was thinking about the issue of Rubyforge only supporting a single  
git repo per project, and the issue of subprojects with git in  
general. While certainly imperfect this idea occurred to me…

Make each subproject it’s own git repo inside a master directory which  
is also a git repo. Git ignores the .git directory in subdirs (you can  
not add these files even if you try explicitly!). But we could trick  
it, if we rename the .git directory. So we would have:

superproj/  
.git/  
subproj1/  
.gitsub  
subproj2/  
.gitsub

When working on a subproject, we first rename .gitsub to .git, do our  
work and then when finished rename it back to .gitsub so the master  
git repo will track it. It’s an added step but could work. At the top  
level we just mass commit the whole as needed. Perhaps some porcelain  
could be made to automate this procedure?

One caveat, I don’t see a way to clone just one subproject --you have  
to clone the whole master repo, but that’s not the end of the world.  
I know it seems crazy to double track the repos, but at least it’s  
pretty simple and is a generic solution.

Thoughts? Issues?

Thanks.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 17, 2009, 6:11pm UTC](https://www.ruby-forum.com/t/git-subprojects-and-rubyforge/173880/2 "2009-08-17T18:11:05Z")

</div>

Intransition wrote:

> ```
> .git/
> 
> ```
> 
> One caveat, I don’t see a way to clone just one subproject --you have  
> to clone the whole master repo, but that’s not the end of the world.  
> I know it seems crazy to double track the repos, but at least it’s  
> pretty simple and is a generic solution.
> 
> Thoughts? Issues?
> 
> Thanks.

Scary…

Btw, Sourceforge recently added multiple hg repos per project[1] and  
plans the same for git. Dunno if rubyforge and sourceforge are similar  
enough for their code to help… Not a high priority for me though…

[1]

> **[SourceForge.net](https://sourceforge.net/projects/sourceforge/)**
>
> Download SourceForge.net for free. Official Support and Documentation for SourceForge.net, provided by the SourceForge.net Service Operations Group (SOG).
