Re: Managing multiple branches in git

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Mark Mielke <mark(at)mark(dot)mielke(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Managing multiple branches in git
Date: 2009-06-02 23:54:50
Message-ID: 20090602235450.GM5845@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund escribió:

> git clone --reference common_repo
> + small
> + staying small
> + fast
> + windows supported
> +- push/fetch needed
> - possibly unsecure if you delete from the master repository - which one
> can easily prevent
>
> git clone --shared
> Essentially the same as the last above

I think these are the two usable options. They will probably end up
making sense (to me at least). We only need to make sure we don't
accidentaly corrupt the WCs, but we should be safe because we don't
intend to "delete branches" in the upstream repository. The note in the
docs:

--shared, -s
When the repository to clone is on the local machine, instead of
using hard links, automatically setup .git/objects/info/alternates
to share the objects with the source repository. The resulting
repository starts out without any object of its own.

NOTE: this is a possibly dangerous operation; do not use it unless
you understand what it does. If you clone your repository using
this option and then delete branches (or use any other git command
that makes any existing commit unreferenced) in the source
repository, some objects may become unreferenced (or dangling).
These objects may be removed by normal git operations (such as
git-commit) which automatically call git gc --auto. (See git-
gc(1).) If these objects are removed and were referenced by the
cloned repository, then the cloned repository will become corrupt.

--reference <repository>
If the reference repository is on the local machine automatically
setup .git/objects/info/alternates to obtain objects from the
reference repository. Using an already existing repository as an
alternate will require fewer objects to be copied from the
repository being cloned, reducing network and local storage costs.

NOTE: see NOTE to --shared option.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-06-03 00:00:09 Re: Managing multiple branches in git
Previous Message Stephen Frost 2009-06-02 23:53:23 Re: Managing multiple branches in git