I have installed Git version 1.7.6.msysgit.0 on our Windows 2003 Server (SP2). This is our main repository for 14 developers.

I am trying to create a backup from this repository. The way I am trying is: I made a clone of this repo on our backup server:

cd to/my/backup/git/folder.git
git clone z:/GIT/Lib.git .

I am now trying to pull changes from the main repository, but I get the following error

git pull
Fatal: ... git-clone cannot be used without a working tree 

The config file under Z:/GIT/Lib.git is:

Z:\GIT\Lib.git>more config
        repositoryformatversion = 0
        filemode = false
        bare = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly
[remote "origin"]
        url = //NAS/GIT/Lib


git status

throws the same error.

I thought the problem was with the :


so I changed it, but did not change the result.

I will NEVER work on the backup folders ( I have 4 repos now under z:/GIT/ - and all need to be backed up in the same way - or somehow)

This article mentions that I need this work-tree, but if I set it, can I have the other repos pulled as well?

The question can be asked also in another format as: What is the best way to make a GIT backup ?

  • Which windows-git are you running? There are a couple of packages out there. – sysadmin1138 Sep 25 '11 at 12:53
  • I missed that: git version 1.7.6.msysgit.0 – Saariko Sep 26 '11 at 6:33

Changing bare at this point won't automagically fix your issue, it's already a bare repository (a repo without a working tree). Use git fetch instead of git pull and you should be fine (git pull is basically just a git fetch to pull in all the updates followed by a git merge to merge the updates into your working tree).

  • super, thanks. All I do than to backup is: git fetch *I am not merging anything, as it's only a backup folder. – Saariko Sep 27 '11 at 12:09

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.