git/list[1] front-page[2] threads[3] people[4] search[5] about
 

copying git repositories ...

From
MMMichael Meeks <michael.meeks@novell.com>
Date
Feb 28, 2011, 14:25 UTC
Message-ID
<1298903102.14697.127.camel@lenovo-w500>
In-Reply-To
<201102252155.13466.andres@anarazel.de>
Hi Andres & Brian,
	Thanks for your help;
On Fri, 2011-02-25 at 21:55 +0100, Andres Freund wrote:
Show 7 quoted lines
> > On Tue, 2011-02-22 at 10:55 -0500, Brian Gernhardt wrote:
> > > FYI: `git clone foo bar` will use hard-links to copy the object
> > > files and is both very fast and space efficient.  (See the
> > > description of `--local` in git-clone(1), which is used by
> > > default for local repositories since git 1.5.3.)  It's also
> > > guaranteed to work while the correctness of `cp -lR` depends
> > > on implementation details of git.
..
> > 	Sounds like just what I need. Unfortunately, it didn't clone some of
> > the pieces I needed; eg. other configured remotes, I ended up with just
> > 'origin' - which was unexpected (and less wonderful than cp -lR ;-).
..
> See the --mirror option for clone
	I tried all of this; none of it did what I had hoped :-)
	git clone src dest
	yields a different repository, with a totally different config /
remotes setup - missing all but a new synthetic origin pointing at the
local files and which can't be git pulled from in the normal way; ie. it
behaves extremely differently to the cp -lR result.
	git clone --mirror src dest
	yields a similar problem-repository, which is for extra measure a bare
checkout, and thus also not what I need.
	I'm really looking for an equivalent of 'cp -lR foo baa' that:
	* uses hard links to save space
	* produces precisely-a-duplicate repository
	For #2 - I would use the verb 'clone' except of course the 'clone' I'm
talking about would be one that is identical, the same, with no
differences (not eg. missing a few limbs ;-) 
	Clearly cp -lR is bad & evil and all that; but it yields exactly what I
need to effectively manage my local trees, multiple checkouts, and
different builds without burning the entire disk.
	Is there a blessed 'cp -lR' wrapper for git that is functionally
identical ? [ and I'm happy of course for some slow divergence, and loss
of efficiency as I pull more changes from time to time into each tree ].
	Sorry for the noise,
		Michael.
-- 
 michael.meeks@novell.com  <><, Pseudo Engineer, itinerant idiot
Previous: Andres FreundNext: Andres Freund
Message 6 of 12 in “libreoffice merge(tool?) issue #3 ...”
  1. Michael MeeksFeb 22, 2011
  2. Brian GernhardtFeb 22, 2011
  3. Michael MeeksFeb 24, 2011
  4. Michael J GruberFeb 25, 2011
  5. Andres FreundFeb 25, 2011
  6. copying git repositories ...Michael Meeks, Feb 28, 2011
  7. Andres FreundFeb 28, 2011
  8. Brian GernhardtFeb 28, 2011
  9. Michael J GruberFeb 22, 2011
  10. Michael MeeksFeb 22, 2011
  11. Michael J GruberFeb 23, 2011
  12. Michael J GruberFeb 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.