2

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
[core]
        repositoryformatversion = 0
        filemode = false
        bare = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly
[remote "origin"]
        url = //NAS/GIT/Lib

Running

git status

throws the same error.

I thought the problem was with the :

bare=true

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 ?

Saariko
  • 1,791
  • 14
  • 45
  • 75

1 Answers1

2

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).

rodjek
  • 3,327
  • 17
  • 14
  • 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