将本地存储库推送到共享主机上的裸服务器存储库

时间:2011-09-13 21:41:30

标签: git

好的......这是交易。当我尝试将我的本地仓库推送到服务器上的裸仓库时,我收到以下错误:

Counting objects: 225, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (220/220), done.
Writing objects: 100% (225/225), 391.31 KiB, done.
Total 225 (delta 25), reused 0 (delta 0)
git: 'index-pack' is not a git-command. See 'git --help'.
error: index-pack exited with error code 1
error: unpack failed: index-pack abnormal exit
To user@ipaddress:/home/user/public_html/dir.git
 ! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'user@ipaddress:/home/user/public_html/dir.git'

现在,当我尝试推送更大的回购时,我只收到此错误消息。当我将单个文件推送到三个文件回购时,它可以完美地工作。怎么了?!?!

注意:我在共享的Web主机上,但我有SSH访问服务器。如果我错过了你需要的东西,请告诉我,我可以发布信息......

感谢您的帮助!

2 个答案:

答案 0 :(得分:0)

这意味着在远程计算机上找不到git-index-pack。它在你的道路上吗?尝试通过ssh命令运行它:

git --exec-path

换句话说,运行以下命令:

ssh user@hostname git --exec-path

看看是否有效。

答案 1 :(得分:0)

有类似的东西,包括

error: unpack failed: index-pack abnormal exit

原来我在服务器上的共享存储库上设置了一些奇怪的权限 - 组没有对所有内容的写权限。一个简单的

chmod -R g+w <repo>

做了这个伎俩。

也做了

chown -R :<group> <repo>
find <repo> -type d -exec chmod g+s {} \;

确保没有将任何内容设置为错误的组