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

Re: integrity of linux copy of a git repo

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 1, 2010, 20:01 UTC
Message-ID
<20101001200102.GA1882@burratino>
In-Reply-To
<i85dub$fp5$1@dough.gmane.org>
Hi Neal,
Neal Kreitzinger wrote:
> If I make a recursive linux copy, "cp -rfp", of a git repo working tree is 
> the resulting copy interchangeable with the original?

Yes, the git metadata does not hardcode the path to the repo anywhere. See gitrepository-layout(7) for perhaps more detail than you wanted.

You might want to use "git add --refresh ." (or even just "git diff") to update the cached stat() information before starting work with the new worktree, but that only matters if you are going to use very low-level commands.

Show 6 quoted lines
> cp -rfp /orig-wk-tree /orig-wk-tree-copy
> (do some stuff that breaks /orig-wk-tree)
> rm -rf /orig-wk-tree
> mv /orig-wk-tree-copy /orig-wk-tree
> 
> Have I truly recovered the full integrity of the original
Sure, that's a good way to do experiments.

Hope that helps, Jonathan

Previous: Neal Kreitzinger
Message 2 of 2 in “integrity of linux copy of a git repo”
  1. Neal KreitzingerOct 1, 2010
  2. Jonathan NiederOct 1, 2010

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.