本文介绍了Gitolite钩不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Cygwin 和 gitolite 上设置了 Windows上的GIT服务器,如 。
在客户端Windows机器上,我使用 TortoiseGit



我可以使用我的SSH密钥,使用[TortoiseGit] 克隆 gitolite-admin 资料库。



在尝试推送 /conf/gitolite.conf 的新内容后,服务器无法再使用我的SSH密钥访问(它由gitolite的服务器上的* authorised_keys *删除)。



gitolite.conf的新内容(我想要添加新的资源库项目):

  repo gitolite-admin 
RW + = alexey

repo Project
RW + = alexey

repo testing
RW + = @all

它有什么问题? >

解决方案

问题出现在 sshd服务环境中。有关详情,请参见。



要解决此问题,请使用正确的PATH变量设置重新安装服务。在Windows Server 2008上使用:

  cygrunsrv -R sshd 
cygrunsrv -I sshd -dCYGWIN sshd -p / usr / sbin / sshd -a-D-y tcpip -u cyg_server -w {cyg_server_password} --envPATH = / usr / local / bin:/ usr / bin:/ bin:/ cygdrive / c / Windows / system32:/ cygdrive / c / Windows:/ cygdrive / c / Windows / System32 / Wbem
cygrunsrv -S sshd

如果您不记得cyg_server帐户密码,您可以重新运行 ssh-host-config



要恢复您的公钥的访问权限:

  gl-setup〜/ YourKey.pub 



之后,您可以远程访问和修改您的gitolite-admin 库。


I've set a GIT server on Windows with Cygwin and gitolite as it's described in the article. On a client Windows machine I use TortoiseGit.

Right after the setup everything works ok. I can clone gitolite-admin repository with TortoiseGit using my SSH key and see the repository content.

But right after I try to push a new content of /conf/gitolite.conf the server is not accessible anymore using my SSH key (it's removed from *authorised_keys* on the server by gitolite).

The new content of gitolite.conf (I would like to add new repository Project):

repo    gitolite-admin
        RW+     =   alexey

repo    Project
        RW+     =   alexey

repo    testing
        RW+     =   @all

What's wrong with it?

解决方案

The problem was in sshd service environment. See this link for details.

To fix the problem reinstall the service with proper PATH variable setting. To do this on Windows Server 2008 use:

cygrunsrv -R sshd
cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -a "-D" -y tcpip -u cyg_server -w {cyg_server_password} --env "PATH=/usr/local/bin:/usr/bin:/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem"
cygrunsrv -S sshd

If you don't remember cyg_server account password you can rerun ssh-host-config.

To restore access for your public key use:

gl-setup ~/YourKey.pub

After these you can access and modify your gitolite-admin repository remotely.

这篇关于Gitolite钩不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 09:50