threads / discuss / 3578

Looking for SCM that lets me publish part of a repository

Subject: Looking for SCM that lets me publish part of a repository

## tl;dr

4 messages between Mar 6, 2006 and Mar 6, 2006.

replies: 3people: 4as markdown or json

Matt McCutchen· Mar 6, 2006, 01:31 UTC · lore
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· Mar 6, 2006, 01:48 UTC · re: Matt McCutchen · lore

Re: Looking for SCM that lets me publish part of a repository

Matt McCutchen <hashproduct@verizon.net> wrote:
Show 9 quoted lines
> 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· Mar 6, 2006, 06:54 UTC · re: Matt McCutchen · lore

Re: Looking for SCM that lets me publish part of a repository

On Monday 06 March 2006 01:31, Matt McCutchen wrote:
Show 7 quoted lines
> 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· Mar 6, 2006, 20:58 UTC · re: Matt McCutchen · lore

Re: Looking for SCM that lets me publish part of a repository

Matt McCutchen wrote:
Show 13 quoted lines
>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.

← back to recent threads