使用git clone一个空的裸仓库碰到意外的报错现象

来源:互联网 发布:电脑系统优化软件知乎 编辑:程序博客网 时间:2024/05/16 15:05

fedora 9 系统环境下

[root@localhost Handset]# git clone git@server_ip:zs_test

Initialized empty Git repository in /root/git_work/Handset/zs_test/.git/

fatal: no matching remote head

fetch-pack from 'git@server_ip:zs_test' failed.

[root@localhost Handset]# git --version
git version 1.5.4.5


ubuntu 11.10 系统环境下

camille@Product:~/git-95-admin/gitolite-admin$ git clone git@server_ip:zs_test

Cloning into zs_test...
warning: You appear to have cloned an empty repository.

camille@Product:~/git-95-admin/gitolite-admin$ git --version
git version 1.7.5.4


我先向zs_test 提交进文件,然后在fedora 9端clone ,结果就成功了。

事实上已经证明:fedora 9上面的git版本过低,导致无法clone一个空的裸仓库。当然即便在较新git版本中你去clone 一个裸仓库也是会警示你的。


随后我升级了fedora 9 上git ,将其升级成为1.7.8 ,然后去clone一的空的裸仓库,ok,成功了。