Gitolite:无法推送到存储库
我现在的情况是,我有一个从 git 存储库克隆的本地源代码树,我正在尝试将其推送到新的远程位置。
我使用打包方法(deb)在服务器上安装了 gitolite。我按照 Wiki 说明 操作,以成功的 git 克隆 gitolite@localhost 结束:gitolite-admin
。然后我添加了新的存储库和我的公钥。我可以在我的机器(客户端)上克隆这个存储库,但无法推送到它。 SSH 故障排除文档描述了我的场景 恰当地:
考虑 git@server:repositories/reponame.git。克隆操作 会起作用——你正在使用完整的 Unix 路径(假设默认 $REPO_BASE 设置),因此 shell 会找到您所说的存储库 会的。但是,当您推送时,gitolite 的更新挂钩就会启动,并且 无法运行,因为它需要一些环境变量 不存在
所以,我可以使用
git clone [email protected]:repositories/reponame.git
但是不适用于
git clone [电子邮件受保护]:reponame.git< /code> (我得到致命: 'reponame.git' 似乎不是 git 存储库
)
如果我对克隆(空)存储库进行更改并尝试推送,我得到
远程:ENV GL_RC 未设置远程:BEGIN 失败 - 编译中止于 挂钩/更新第 20 行。远程:错误:挂钩拒绝更新 参考文献/头/大师
所以,这似乎与前缀有关 - 但是,正如我所提到的,如果不在路径中包含 repositories/
说明符,我就无法克隆存储库。
这就是所谓的“绕过gitolite”吗?我该如何纠正这种情况?最终,我想将整个现有的源代码树推送到新的远程服务器(我已将新服务器添加为 .git/config
中的远程服务器),并维护历史记录。
I'm in a situation where I have a local source tree that was cloned from a git repository, that I'm trying to push to a new remote location.
I installed gitolite on the server using the package method (deb). I followed the Wiki instructions, ending with a successful git clone gitolite@localhost:gitolite-admin
. I then added the new repository, and my public keys. I can clone this repository on my machine (the client), but am not able to push into it. The SSH troubleshooting document describes my scenario aptly:
consider git@server:repositories/reponame.git. The clone operation
will work -- you're using the full Unix path, (assuming default
$REPO_BASE setting), and so the shell finds the repo where you said it
would be. However, when you push, gitolite's update hook kicks in, and
fails to run because some of the environment variables it is expecting
are not present
So, I can clone with
git clone [email protected]:repositories/reponame.git
but not with
git clone [email protected]:reponame.git
(I get fatal: 'reponame.git' does not appear to be a git repository
)
If I make changes to the cloned (empty) repository and try to push, I get
remote: ENV GL_RC not set remote: BEGIN failed--compilation aborted at
hooks/update line 20. remote: error: hook declined to update
refs/heads/master
So, this seems related to the prefixing - however, as I've mentioned, I can not clone the repo without including the repositories/
specifier in the path.
Is this what is meant by "bypassing gitolite"? How can I rectify the situation? Ultimately, I want to push the entire pre-existing source tree to the new remote (I've added the new server as a remote in .git/config
), and maintain history.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议使用客户端方法安装 gitolite。对我来说,它解决了这个问题。
I would recommend installing gitolite with the client method. For me it took care of this exact issue.
reponame.git 的路径不正确。
您应该添加前缀 repositories/
表示 reponame.git 位于 /home/gitolite/repositories/reponame.git。
The path of reponame.git is not right.
You should add the prefix repositories/
means the reponame.git is locate at /home/gitolite/repositories/reponame.git.