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

Re: how to make "full" copy of a repo

From
Kevin D <me@ikke.info>
Date
Mar 29, 2015, 11:05 UTC
Message-ID
<20150329110506.GC9387@vps892.directvps.nl>
In-Reply-To
<1427595686.4912.17.camel@scientia.net>
On Sun, Mar 29, 2015 at 04:21:26AM +0200, Christoph Anton Mitterer wrote:
Show 8 quoted lines
> On Sat, 2015-03-28 at 15:31 +0100, Kevin D wrote: 
> [..]
> 
> > * reflog (history of refs, though, by default disabled for bare
> >   repositories)
> is there a way to get this copied?
> 
> 

No, the reflog is considered something private to the repository, so there is no way to git it through git clone.

Show 6 quoted lines
> [..] 
> 
> > git clone --mirror is used for repositories that regularly get updates
> > from the repositories they were cloned from. Though this is not what you
> > want, it's not difficult to reset the refspecs to the default refspecs.
> What do you mean here? What would I need to reset exactly?

git clone --mirror sets up the fetch refspec in such a way that local refs would get reset to whatever upstream has:

+refs/*:refs/*

So every time you would fetch / pull, all your branches would reflect the way they are on the mirrored repo (which is why it's called mirror).

The default refspec is:
+refs/heads/*:refs/remotes/origin/*

Which would only fetch heads (branches), and maps them as remote tracking branches, so that your local branches are left alone.

Show 10 quoted lines
> > git clone --mirror is the closest you are going to get by only using
> > git.
> I see, thanks :)
> 
> > So to summarize, git clone is only used for cloning history, which means
> > objects and refs, the rest is not part of cloning. To get more, you have
> > to go outside git.
> 
> Thanks :)
> Chris.
Previous: Christoph Anton MittererNext: Duy Nguyen
Message 4 of 9 in “how to make "full" copy of a repo”
  1. Christoph Anton MittererMar 28, 2015
  2. Kevin DMar 28, 2015
  3. Christoph Anton MittererMar 29, 2015
  4. Kevin DMar 29, 2015
  5. Duy NguyenMar 30, 2015
  6. Junio C HamanoMar 30, 2015
  7. Torsten BögershausenMar 28, 2015
  8. Ævar Arnfjörð BjarmasonMar 28, 2015
  9. Christoph Anton MittererMar 29, 2015

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.