原版本控制文件删除,客户端git push报错问题

489 views
Skip to first unread message

addcn

unread,
Apr 13, 2012, 7:19:55 AM4/13/12
to Git中文用户组
服务器192.168.8.35
客户端192.168.8.36

服务器上在一个存在的git建立中心版本控制
cd /home
git clone --bare /home/demo.git test.git
rm -d /home/demo.git <----------------------------如果把原版本控制文件删
除,客户端git push报错

客户端检出
git clone ssh://ad...@192.168.8.35/home/test.git
vi test.txt
git add test.txt
git commit -m"add line"
git push

error:object directory /home/demo.git/objects does not exist;
check .git/objects/info/alternates.
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
error:refs/heads/master does not point to a valid object!
fatal: The remote end hung up unexperctedly
....

如果把原版本控制文件删除,客户端git push报以上错误,不删除则没有问题。
好象看到文章说只要.git,不需要其它文件的,是我那里设置错误了吗?

Wendal Chen

unread,
Apr 13, 2012, 7:23:22 AM4/13/12
to git...@googlegroups.com
git push -u origin master
--
Wendal Chen
GuangDong China

addcn

unread,
Apr 13, 2012, 7:25:48 AM4/13/12
to Git中文用户组
试过了,换是报错误:

error:object directory /home/demo.git/objects does not exist;
check .git/objects/info/alternates.

Wendal Chen

unread,
Apr 13, 2012, 7:41:07 AM4/13/12
to git...@googlegroups.com
我的神啊...

你把服务器端的.git删除? 那服务器端就已经不是git库!!

addcn

unread,
Apr 13, 2012, 7:47:19 AM4/13/12
to Git中文用户组
git clone --bare /home/demo.git test.git


只是把服务器初始时clone的demo.git删除了
正在使用的test.git 还是存在的

AleiPhoenix (A.K.A Areverie)

unread,
May 4, 2012, 1:07:02 PM5/4/12
to git...@googlegroups.com
把情况整理一下,

第一封邮件里操作是在server端做的吗?

2012/4/13 addcn <lhu...@gmail.com>



--
Silence is gold.

twitter: @areverie
wikipedia: AleiPhoenix
blog: weblog.areverie.org
wiki: wiki.areverie.org


addcn

unread,
May 7, 2012, 1:46:21 AM5/7/12
to Git中文用户组
是的,server端做的

On 5月5日, 上午1时07分, "AleiPhoenix (A.K.A Areverie)"

Reply all
Reply to author
Forward
0 new messages