# Looking for SCM that lets me publish part of a repository

4 messages from 2006-03-06 to 2006-03-06. Participants: Matt McCutchen, Shawn Pearce, Alan Chandler, Sam Vilain.
Thread: https://gitlist.dev/t/3578

## Matt McCutchen, 2006-03-06 01:31

Subject: Looking for SCM that lets me publish part of a repository
Message-ID: <1141608679.16980.12.camel@mattlaptop>
URL: https://gitlist.dev/e/1141608679.16980.12.camel%40mattlaptop

```
Dear GIT people,

For the last week or so, I have been looking for a SCM system to hold
many of my projects, some of which are available to the public and
others of which are not.  It would be nice if I could use a single large
private repository on my computer with each project in a separate
folder.  Then I would like to pull some of the projects (but not all)
into a world-readable repository on my Web site.  I have looked at
several SCMs and have not found a way to make any of them do this, but I
like GIT best on other grounds.  Is there a way I can coerce GIT to
clone and pull one folder out of a repository but ignore the rest?
-- 
Matt McCutchen
hashproduct@verizon.net
http://hashproduct.metaesthetics.net/

```

## Shawn Pearce, 2006-03-06 01:48

Subject: Re: Looking for SCM that lets me publish part of a repository
Message-ID: <20060306014830.GE25790@spearce.org>
URL: https://gitlist.dev/e/20060306014830.GE25790%40spearce.org
In-Reply-To: <1141608679.16980.12.camel@mattlaptop>

```
Matt McCutchen <hashproduct@verizon.net> wrote:
> For the last week or so, I have been looking for a SCM system to hold
> many of my projects, some of which are available to the public and
> others of which are not.  It would be nice if I could use a single large
> private repository on my computer with each project in a separate
> folder.  Then I would like to pull some of the projects (but not all)
> into a world-readable repository on my Web site.  I have looked at
> several SCMs and have not found a way to make any of them do this, but I
> like GIT best on other grounds.  Is there a way I can coerce GIT to
> clone and pull one folder out of a repository but ignore the rest?

No.  And actually this is probably not the best way to use GIT.

If you want to segment your work into ``public'' and ``non-public''
then you should at least segment your work into two repositories:
``public'' and ``non-public''.  But you really should segment your
repository to a project-by-project basis.  That is each project
should have its own repository.

That said if there are many files which will have identical content
across many projects you may be able to save disk space by placing
all objects into a single object directory; but that's entirely
independent of project organization.

Unlike CVS, Subversions, etc. GIT repositories are dirt-cheap to
create.  Don't think twice about creating a different repository
for a new project.  I think I'm up on about 50 repositories at
this point; however each one is typically less than a megabyte in
total size.

-- 
Shawn.

```

## Alan Chandler, 2006-03-06 06:54

Subject: Re: Looking for SCM that lets me publish part of a repository
Message-ID: <200603060654.12815.alan@chandlerfamily.org.uk>
URL: https://gitlist.dev/e/200603060654.12815.alan%40chandlerfamily.org.uk
In-Reply-To: <1141608679.16980.12.camel@mattlaptop>

```
On Monday 06 March 2006 01:31, Matt McCutchen wrote:
> Dear GIT people,
>
> For the last week or so, I have been looking for a SCM system to hold
> many of my projects, some of which are available to the public and
> others of which are not.  It would be nice if I could use a single large
> private repository on my computer with each project in a separate
> folder. 

Not sure why you would want to do this against having lots of smaller 
repositories - (I have lots of small repositories - its mostly java, and my 
shared library files have their own repository which is automatically 
exported to where my projects can access it when I commit to it via a post 
commit hook - you can see the public version of them on my web site) but ...

Create each project on a separate branch of the common repository and ensure 
only the files you want in each project remains on each branch (and any 
shared files can exist in all branches).

In your "remotes" files you list the branches that you want to push to your 
public repository.
-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

```

## Sam Vilain, 2006-03-06 20:58

Subject: Re: Looking for SCM that lets me publish part of a repository
Message-ID: <440CA280.6000304@vilain.net>
URL: https://gitlist.dev/e/440CA280.6000304%40vilain.net
In-Reply-To: <1141608679.16980.12.camel@mattlaptop>

```
Matt McCutchen wrote:

>Dear GIT people,
>
>For the last week or so, I have been looking for a SCM system to hold
>many of my projects, some of which are available to the public and
>others of which are not.  It would be nice if I could use a single large
>private repository on my computer with each project in a separate
>folder.  Then I would like to pull some of the projects (but not all)
>into a world-readable repository on my Web site.  I have looked at
>several SCMs and have not found a way to make any of them do this, but I
>like GIT best on other grounds.  Is there a way I can coerce GIT to
>clone and pull one folder out of a repository but ignore the rest?
>  
>

SVK works like this, you get one (by default) repository in your ~ which
you then mirror published projects to, and it tracks local changes as a
branch which you can then commit back 'upstream' (or to your published
repository) with.

Jeff King also recently posted a script to extract out a part of a
repository into another one, which is a related concept.

Sam.

```
