Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it safe to use a copied git repo?
    primarykey
    data
    text
    <p>If I make a copy of a tracked folder using <code>rsync -a</code> or <code>cp -R</code>, can I then use the copy as if it were a git clone, or will that cause all sorts of weird problems? This is all running on my computer, so no one else is accessing the repository.</p> <p>Obviously, the git-cloned dir know where it was copied from, so I can do <code>git pull</code> without specifying a source, but assuming I am willing to live without that, is there something I need to worry about?</p> <p>As an experiment, I created a little project, <code>clone</code>d it and <code>rsync</code>ed it, and <code>diff</code>ed the resulting folders. Here are the results:</p> <pre><code>itsadok@quad ~ $ git clone project/.git project2 Initialized empty Git repository in /home/itsadok/project2/.git/ itsadok@quad ~ $ rsync -a project/ project3/ itsadok@quad ~ $ diff -r project2 project3 Only in project3/.git: COMMIT_EDITMSG diff -r project2/.git/config project3/.git/config 7,12d6 &lt; [remote "origin"] &lt; url = /home/itsadok/project/.git &lt; fetch = +refs/heads/*:refs/remotes/origin/* &lt; [branch "master"] &lt; remote = origin &lt; merge = refs/heads/master Files project2/.git/index and project3/.git/index differ diff -r project2/.git/logs/HEAD project3/.git/logs/HEAD 1c1 &lt; 0000000000000000000000000000000000000000 bf6be23d68d0ede45aca7479795693bfba76e73a itsadok &lt;itsadok@quad.(none)&gt; 1242131284 +0300 clone: from /home/itsadok/project/.git --- &gt; 0000000000000000000000000000000000000000 bf6be23d68d0ede45aca7479795693bfba76e73a itsadok &lt;itsadok@quad.(none)&gt; 1242131066 +0300 commit (initial): first commit diff -r project2/.git/logs/refs/heads/master project3/.git/logs/refs/heads/master 1c1 &lt; 0000000000000000000000000000000000000000 bf6be23d68d0ede45aca7479795693bfba76e73a itsadok &lt;itsadok@quad.(none)&gt; 1242131284 +0300 clone: from /home/itsadok/project/.git --- &gt; 0000000000000000000000000000000000000000 bf6be23d68d0ede45aca7479795693bfba76e73a itsadok &lt;itsadok@quad.(none)&gt; 1242131066 +0300 commit (initial): first commit Only in project2/.git/logs/refs: remotes Only in project2/.git: packed-refs Only in project2/.git/refs: remotes </code></pre> <p>There's quite a bit of a difference, but most of it seems to be about the reference to the origin. Am I right?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload