threads / discuss / 25547

Are "private blobs/trees" possible?

Subject: Are "private blobs/trees" possible?

## tl;dr

4 messages between Oct 25, 2010 and Oct 26, 2010.

replies: 3people: 3as markdown or json

Kynn Jones· Oct 25, 2010, 19:19 UTC · lore

There are some files that I want to keep under local git control, but never push to any remote repositories.

What's the best way to implement this idea with git?

The best solution I can think of is to put these files in some git-controlled directory that is not below the "main" working directory, and have an (ignored) symlink to it in this working directory.

Is there a better way?
TIA!
~kj
Drew Northup· Oct 25, 2010, 20:10 UTC · re: Kynn Jones · lore

Re: Are "private blobs/trees" possible?

On Mon, 2010-10-25 at 15:19 -0400, Kynn Jones wrote:
Show 12 quoted lines
> There are some files that I want to keep under local git control, but never
> push to any remote repositories.
> 
> What's the best way to implement this idea with git?
> 
> The best solution I can think of is to put these files in some
> git-controlled directory that is not below the "main" working directory, and
> have an (ignored) symlink to it in this working directory.
> 
> Is there a better way?
> 
> TIA!

There is no restriction that you only have one git repository on any given machine.... Set up your symlink to those files in their own git repository.

-- 
-Drew Northup N1XIM
   AKA RvnPhnx on OPN
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
Seth Robertson· Oct 25, 2010, 20:43 UTC · re: Drew Northup · lore

Re: Are "private blobs/trees" possible?

In message <1288037406.819.93.camel@drew-northup.unet.maine.edu>, Drew Northup writes:

    On Mon, 2010-10-25 at 15:19 -0400, Kynn Jones wrote:
    > There are some files that I want to keep under local git
    > control, but never push to any remote repositories.
    > What's the best way to implement this idea with git?
    > The best solution I can think of is to put these files in some
    > git-controlled directory that is not below the "main" working
    > directory, and have an (ignored) symlink to it in this working
    > directory.
    > Is there a better way?
    There is no restriction that you only have one git repository on any
    given machine.... Set up your symlink to those files in their own git
    repository.

Depending on your proposed workflow (e.g. do you want to perform many git operations such as commit, push, pull, tag, branch, etc) on the public and private repositories at the same time even if they go different places, a multi-repository management system like gitslave (http://gitslave.sf.net) might work for you. If you do not plan to branch/tag your private repository along with the public repository or do not have an "upstream" for your private repository, the symlink approach is probably the best.

In either case, remember .git/info/exclude and git-config's core.excludesfile for a way to privately ignore the symlink or gitslave files.

					-Seth Robertson
Kynn Jones· Oct 26, 2010, 16:56 UTC · re: Seth Robertson · lore

Re: Are "private blobs/trees" possible?

Actually, it occurred to me after posting that the symlinking is not necessary. As long as the private directory is ignored, then it can have its own independent (and purely local) git repository.

But I'll look into the multi-repo management system that Seth mentioned.
Thanks!

← back to recent threads