Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question
    
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

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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