Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>See <a href="http://blog.costan.us/2009/02/synchronizing-git-repositories-without.html" rel="noreferrer">this blog post "Synchronizing Git repositories without a server "</a> (by <a href="http://www.blogger.com/profile/13804381550088697006" rel="noreferrer">Victor Costan</a>).</p> <blockquote> <p>This post describes a method for pushing changes between two repositories without using a server with network connections to both hosts having repositories</p> </blockquote> <p>Start up by creating a repository on the USB stick.</p> <pre><code>mkdir /path/to/usb/stick/repository.git git clone --local --bare . /path/to/usb/stick/repository.git </code></pre> <p>Then register the repository on the USB stick as a remote repository, and push the desired branch to it (if you don't want to push master, substitute your desired branch).</p> <pre><code>git remote add usb file:///path/to/usb/stick/repository.git git push usb master </code></pre> <p>In the future, you can treat the USB repository as any other remote repository. Just make sure it's mounted :) For instance, the following pushes new changes to the USB repository.</p> <pre><code>git push usb </code></pre> <p>On the receiving end, mount the USB stick, and use a file URL for the repository</p> <pre><code>file:///path/to/usb/stick/repository.git </code></pre> <p>A few handy commands:</p> <pre><code># cloning the repository on the USB stick git clone file:///path/to/usb/stick/repository.git # updating a repository cloned from the USB stick using the above command git pull origin # adding the USB stick repository as a remote for an existing repository git remote add usb file:///path/to/usb/stick/repository.git # updating from a remote repository configured using the above command git pull usb master </code></pre>
 

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