Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use the <strong><a href="http://progit.org/book/ch4-1.html" rel="nofollow noreferrer">local protocol</a></strong>: a simple shared path is enough for two Git repositories on two PC on the same LAN to push/pull from each other.<br> No need (in this case) for a "central" server.</p> <hr> <p>As <a href="https://stackoverflow.com/users/47207/noel-kennedy">Noel Kennedy</a> points out in the comments, he had to locally map a drive letter to the remote repo before executing: <code>git clone file:///z</code>.<br> <strong>That is the safest path, since <a href="http://code.google.com/p/msysgit/issues/detail?id=351" rel="nofollow noreferrer">UNC paths are not always supported with some versions of msysgit</a>.</strong></p> <p>You can use UNC paths with recent msysgit versions though, like in a Git bash session:</p> <pre><code>$ cd /c/temp $ git clone //remote-host/share/path/to/repo.git </code></pre> <p>(note the '<code>/</code>' instead of the Windows '<code>\</code>')</p> <p>In a DOS session, after adding the <code>mingw/bin</code> path, it might work too (i.e. using an UNC path instead of a mapped drive)</p> <pre><code>C:\temp&gt;set PATH=%PATH%;c:\msysgit\bin;c:\msysgit\mingw\bin C:\temp&gt;git clone \\\\remote-host\\share\\path\\to\\repo.git </code></pre> <hr> <p>Update August 2014 (4 years later), Git 2.1</p> <p><a href="https://github.com/git/git/commit/c2369bdf7ff082d588c4a4efe280bc4a483d0192" rel="nofollow noreferrer">Commit c2369bd</a> by Eric Sunshine and <a href="https://github.com/czawadka" rel="nofollow noreferrer">Cezary Zawadka (<code>czawadka</code>)</a> means a simpler UNC path now work:</p> <h3>Windows: allow using UNC path for git repository</h3> <blockquote> <p>Eric Sunshine fixed <code>mingw_offset_1st_component()</code> to return consistently "<code>foo</code>" for UNC "<code>//machine/share/foo</code>", cf <a href="http://groups.google.com/group/msysgit/browse_thread/thread/c0af578549b5dda0" rel="nofollow noreferrer">this thread</a>.</p> </blockquote> <p>So this should now work:</p> <pre><code>git clone //mymachine/shared/repo.git </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