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

Re: why git-reset needed after "cp -a" of a git repo?

From
Jon Loeliger <jdl@freescale.com>
Date
Aug 22, 2007, 19:04 UTC
Message-ID
<1187809479.15321.15.camel@ld0161-tx32>
In-Reply-To
<200708221857.l7MIv5tD011053@agora.fsl.cs.sunysb.edu>
On Wed, 2007-08-22 at 13:57, Erez Zadok wrote:
Show 11 quoted lines
> However, I noticed that after I copy a git repo (using v1.5.2.2), the index
> entries are all out of sync, and I need to run git-reset.  Why?  What's in
> the index file that changes after a cp -a or rsync that git depends on?  Is
> it atime's and if so, aren't they copied by cp -a or rsync?  If it depends
> on atime's, what happens if I mount my filesystem with noatime?  Or does
> git's index depends on inode numbers which change after a cp -a?  (BTW, I
> tried a variety of rsync options and none helped.)  I also briefly looked at
> the source code and wasn't able to find the answer.
> 
> So, is there a way to efficiently copy a git repo on a local or remote host
> w/o having to rerun git-reset afterwards?
Use "git update-index --refresh" to update time stamps in the index.
jdl
Previous: Erez ZadokNext: Linus Torvalds
Message 2 of 5 in “why git-reset needed after "cp -a" of a git repo?”
  1. Erez ZadokAug 22, 2007
  2. Jon LoeligerAug 22, 2007
  3. Linus TorvaldsAug 22, 2007
  4. Erez ZadokAug 22, 2007
  5. J. Bruce FieldsAug 22, 2007

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.