Note that there are some explanatory texts on larger screens.

plurals
  1. POgit setup for backup & sync between 2 computers
    primarykey
    data
    text
    <p>I'm new to git. Need some advise to know if my setup is correct. Please read below : </p> <p>I'm using git for 2 separate projects on my development computer and want to backup everything on a USB drive (setup as a git bare repo). Additionally, I want to sync these projects on another computer (for deployment). </p> <p>The 2 projects paths on computer1 are</p> <pre><code>/machine1/path/proj1 /machine1/path/proj2 </code></pre> <p>This is how I've setup (repeated exact same steps for proj2)</p> <pre><code>#Initialize git repo cd /machine1/path/proj1 git init git add . git commit -a -m "proj 1 first commit" </code></pre> <hr> <pre><code>#Backup on USB cd /usb/backup mkdir proj1.git cd proj1.git git init --bare cd /machine1/path/proj1 git push --mirror /usb/backup/proj1.git </code></pre> <hr> <pre><code>#Clone to other computer cd /machine2/path git clone /usb/backup/proj1.git #After making changes on machine1, I update machine2 using this command git pull /usb/backup/proj1.git </code></pre> <p>Question: </p> <ol> <li>Are these steps correct for (i) setup, (ii) backup on USB, (iii) sync to other machines? Or is there a <strong>right/better way to do it</strong> ? </li> <li>I mistakenly executed these commands</li> </ol> <blockquote> <p></p> </blockquote> <pre><code>cd /machine2/path/proj2 git pull /usb/backup/proj1.git </code></pre> <p>I expected git to show an error message ... something like "trying to sync proj2 with proj1 repo" but instead it created a subdirectory of proj2 inside proj1. Is there a shortcoming in my setup ? I expected an action like this would require a <code>--force</code> switch or else produce a fatal error</p>
    singulars
    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