title: How to clone a local Git repository using Node.js?
body: <p>I'm trying to clone a Git repository that resides on my local drive into a new folder. So far, I've tried several modules, from which <a href="https://github.com/creationix/js-git" rel="nofollow">creationix/js-git</a> seemed to be the most promising one.</p>
  
  <p>The code to fetch I use is:</p>
  
  <pre><code>  var source = '...',
        target = '...';
  
    var remoteRepository = git.remote('file://' + source),
        localRepository = git.repo(target);
  
    var options = {
      onProgress: function (progress) {
        console.log(progress);
      }
    };
  
    localRepository.fetch(remoteRepository, options, function (err) {
      if (err) { throw err; }
      console.log('Done');
    });
  </code></pre>
  
  <p>Unfortunately, this does not work, as <code>js-git</code> complains about an unknown URL format, which relates to the <code>file://</code> protocol being used. The same error appears when I remove the <code>file://</code> portion.</p>
  
  <p>I also tried to change <code>git.remote</code> to <code>git.repo</code> (as it's not an actual remote), but then I get:</p>
  
  <pre><code>TypeError: Object #&lt;Object&gt; has no method 'discover'
  </code></pre>
  
  <p>So, apparently <code>js-git</code> does not support fetching from local repositories (or I was not able to find out how to do it).</p>
  
  <p>Does anyone…</p>
  
  <ul>
  <li>…either know how to solve this using <code>js-git</code>,</li>
  <li>or can suggest a viable alternative?</li>
  </ul>
  
  <p>Any help is appreciated :-)</p>