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

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

 




On Wed, 22 Aug 2007, Erez Zadok wrote:
> 
> 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?

ctime/mtime and inode numbers too.

If you use hardlinks to copy the working tree, *and* you reset ctime 
afterwards, you'd be ok. But basically, git tries to be *really* anal in 
noticing any possible change to the inode, so anything it can do to notice 
that the index file might be stale, it does.

But you don't need to do a "git reset", you're actually better off just 
doing a "git status" instead. That will refresh the index.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux