{"thread":{"id":"25311","subject":"integrity of linux copy of a git repo","startedAt":"2010-10-01T19:47:50Z","lastAt":"2010-10-01T20:01:02Z","messageCount":2,"participants":["Neal Kreitzinger","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"152259","messageId":"i85dub$fp5$1@dough.gmane.org","threadId":"25311","inReplyTo":null,"subject":"integrity of linux copy of a git repo","fromName":"Neal Kreitzinger","fromEmail":"neal@rsss.com","sentAt":"2010-10-01T19:47:50Z","receivedAt":"2010-10-01T19:47:50Z","isPatch":false,"sender":{"key":"neal@rsss.com","avatar":null},"body":"If I make a recursive linux copy, \"cp -rfp\", of a git repo working tree is \nthe resulting copy interchangeable with the original?\n\ne.g.\n/orig-wk-tree was created via git-clone with the file:/// url and therefore \nis a \"full copy\"\ncp -rfp /orig-wk-tree /orig-wk-tree-copy\n(do some stuff that breaks /orig-wk-tree)\nrm -rf /orig-wk-tree\nmv /orig-wk-tree-copy /orig-wk-tree\n\nHave I truly recovered the full integrity of the original, or have I \nunwittingly introduced some sort of corruption?\n\nv/r,\nNeal\n"},{"id":"152260","messageId":"20101001200102.GA1882@burratino","threadId":"25311","inReplyTo":"i85dub$fp5$1@dough.gmane.org","subject":"Re: integrity of linux copy of a git repo","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T20:01:02Z","receivedAt":"2010-10-01T20:01:02Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Neal,\n\nNeal Kreitzinger wrote:\n\n> If I make a recursive linux copy, \"cp -rfp\", of a git repo working tree is \n> the resulting copy interchangeable with the original?\n\nYes, the git metadata does not hardcode the path to the repo anywhere.\nSee gitrepository-layout(7) for perhaps more detail than you wanted.\n\nYou might want to use \"git add --refresh .\" (or even just \"git diff\")\nto update the cached stat() information before starting work with the\nnew worktree, but that only matters if you are going to use very\nlow-level commands.\n\n> cp -rfp /orig-wk-tree /orig-wk-tree-copy\n> (do some stuff that breaks /orig-wk-tree)\n> rm -rf /orig-wk-tree\n> mv /orig-wk-tree-copy /orig-wk-tree\n> \n> Have I truly recovered the full integrity of the original\n\nSure, that's a good way to do experiments.\n\nHope that helps,\nJonathan\n"}]}