title: Git Fetch Error with UNC
body: <p>I have a GIT backup script that runs perfectly when executed from command line (it's a daily backup of our main GIT rep):</p>
  
  <pre><code>@echo off
  rem -- Set Parameters
  rem -- daliy GIT backup
  REM Get DATE
  set mm=%Date:~4,2%
  set dd=%Date:~7,2%
  set yy=%Date:~10,4%
  set TODAY=%yy%%mm%%dd%
  for /f %%a in ('date /t') do set DAY=%%a
  if %DAY%==Sun goto :weekend
  if %DAY%==Sat goto :weekend
  goto :weekday
  :weekend
  :: No backup after weekends
  echo %day%
  exit
  :weekday
  :: Backup during weekdays
  REM Connect to share
  REM net use z: \\backupnas\backup\
  Z:
  cd \
  cd git
  REM Start backup of current GITS
  cd OptiTexRepo.git
  call git fetch
  cd ..
  RAR.exe a -rr10 -s ARCHIVES\%TODAY%.OptiTexRep.git.rar OptiTexRepo.git
  cd OptiTexRepo_V11.1.git
  call git fetch
  cd ..
  RAR.exe a -rr10 -s ARCHIVES\%TODAY%.OptiTexRepo_V11.1.git.rar OptiTexRepo_V11.1.git
  REM exit
  </code></pre>
  
  <p>However, when I run it as a scheduled task from a W2008R2 server, on a daily basis, it immediately exists (very similar to question <a href="https://serverfault.com/questions/343496/powershell-script-works-from-command-line-not-from-task-scheduler-why">https://serverfault.com/questions/343496/powershell-script-works-from-command-line-not-from-task-scheduler-why</a>)
  That gave me an idea, to check weather GIT FETCH works correctly with UNC - apparently it does, but when running in a task - something is wrong - and I can't figure what.</p>
  
  <p>According to question: <a href="https://stackoverflow.com/questions/4998549/git-on-unc-path">git on UNC path</a>  git should work, but I don't understand what needs to be the script command in order for it to actually work.</p>
  
  <ul>
  <li><p>Currently I map my backup drive to Z:, and when I CD to the folder, I simply GIT FETCH (that reads from the config file where the master is)</p></li>
  <li><p>How can I do that with using UNC? that will also work from the task scheduler?</p></li>
  <li><p>Or is the problem actually somewhere else?</p></li>
  </ul>