title: GIT clone to external drive for backup
body: <p>We have GIT set up within our windows network (using msysgit &amp; GitExtensions).  We each have our own repositories and we push to a remote 'bare' repository on one of our servers.  All good.</p>
  
  <p>I'm trying to set up a scheduled job on the server, which will clone a repository from the C drive to an external drive (on F) - having some difficulty getting this to work.  I can do this in GIT bash relatively easily, but I'm not sure how to save this into a batch file that I can then scehdule.</p>
  
  <p>What I have so far:</p>
  
  <pre><code>rmdir F:\GitClone /s /q
  mkdir F:\GitClone
  mkdir F:\GitClone\Repo1
  CD /D F:\GitClone\Repo1\
  GIT CLONE /c/GIT/Repo1/
  </code></pre>
  
  <p>I've also tried the following for the last line:</p>
  
  <pre><code>GIT CLONE C:\GIT\Repo1\
  </code></pre>
  
  <p>But this doesn't work either... I'm a little stumped and would appreciate some help.  The C drive contains our bare repositories and the F drive being our external drive that we swap out daily...</p>
  
  <hr>
  
  <p>Several answers here that have been very useful, thanks.  My resulting answer is probably a combination of these, so points for pointing out how to run a bash script and how to script the pull/push.  </p>
  
  <p>Need to bring these together to work so that it's happy when various drives are swapped in and out (i.e. clone a repository if it doesn't exist on the external drive and then only pull the differences otherwise), but that should be doable.  Thanks to all.</p>