[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Git question. Is there a way of duplicating a git repository?

From: Alan Mackenzie
Subject: Re: Git question. Is there a way of duplicating a git repository?
Date: Sat, 14 Nov 2015 21:35:50 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

Hello, John.

On Sat, Nov 14, 2015 at 10:17:33AM -0800, John Wiegley wrote:
> >>>>> Alan Mackenzie <address@hidden> writes:

> > So, is there any convenient way of duplicating a repo (using hard links, and
> > preserving config info)?

> A clone on the same device uses hard-links by default.

But what git calls a "clone" is not a duplicate repo.  It is radically
different from the original.  In particular, the new repo's "remote
origin" is set to the original repo; I want it to duplicate what the
original repo had set.

> A --shared clone uses a symbolic link, so works across devices. However,
> changes to the original repository affect it as well.

This isn't what I want.

> "git worktree add" lets you create a new working tree directly associated with
> a single repository, using neither hardlinks nor symlinks; but has the added
> overhead of having to learn the "git worktree" set of commands.

That wasn't what I asked about either.  Maybe it might do, though it is
bound to have drawbacks.

What I want is a command (or a ready recipe) to do for git repositories
what `fork' does for processes (but sharing the maximum possible from
the original repository with hard links).  After writing my opening post
I even tried a `git clone --mirror', but the resulting repository wasn't
a mirror of the original at all.

> John

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]