Here's my problem:
- I create a new git repository named 'project'. It has some files in it.
I clone that repository with:
git clone --bare project project.git
Git tells me:
Cloning into bare repository 'project.git'... done. error: refs/head/master does not point to a valid object!
I do get a directory named project.git but if I go on with:
git init --bare --shared project.git
git clone project.git project2
Git tells me:
Cloning into 'project2'... warning: You appear to have cloned an empty repository. done.
So I now have no files in the cloned repository: 'project2'. I first encountered this problem with an existing repository that I was trying to share by a bare clone as I usually do. Now it happens with all new repositories that I create. However, If I create the reposotory then copy it to my other machine and then make the bare clone on it, I have no problems.
Any ideas?
Thanks
Update:
The probelm is only occurin on a network drive not the local disk. C is my local disk and H is my network disk:
Local = no problems:
$ cd c:/temp $ mkdir foo; cd foo $ git init Initialized empty Git repository in c:/temp/foo/.git/ $ echo 'a' > a; git add a; git commit -m 'a' warning: LF will be replaced by CRLF in a. The file will have its original line endings in your working directory. [master (root-commit) f695c9d] a warning: LF will be replaced by CRLF in a. The file will have its original line endings in your working directory. 1 file changed, 1 insertion(+) create mode 100644 a $ cd .. $ git clone --bare foo foo.git Cloning into bare repository 'foo.git'... done. $ ls foo.git/ HEAD config description hooks info objects packed-refs refs
Network disk = problems:
$ cd h: $ mkdir foo; cd foo $ git init Initialized empty Git repository in h:/foo/.git/ $ echo 'a' > a; git add a; git commit -m 'a' warning: LF will be replaced by CRLF in a. The file will have its original line endings in your working directory. [master (root-commit) 5348b42] a warning: LF will be replaced by CRLF in a. The file will have its original line endings in your working directory. 1 file changed, 1 insertion(+) create mode 100644 a $ cd .. $ git clone --bare foo foo.git Cloning into bare repository 'foo.git'... done. error: refs/heads/master does not point to a valid object! $ ls foo.git/ HEAD config description hooks info objects packed-refs refs