douna1941 2012-02-07 22:34
浏览 44
已采纳

将Gitolite服务器上的回购推送到Gitolite,同时还能够从客户端推送和拉出

I have a Gitolite server which I push my website source code to. The server then clones the repo into the websites folder using a hook. I would like to be able to change files in a PHP script in my website then have the PHP script automatically add, commit, and push these changed files back to the Gitolite server.

So far, I've managed to add and commit the files, but I cannot push them. If I try to push to the local reference to the repository, I am told it doesn't appear to be a repo (a file permissions problem I think as it worked with sudo), and if I try to push via SSH, I cannot specify a private key as I'm running this under the _www user in Lion Server. Is it possible to push locally to a local Gitolite repo?

  • 写回答

1条回答 默认 最新

  • dongxin991209 2012-02-08 07:21
    关注

    The idea with pushing to Gitolite is to make sure Gitolite can get your id, in order to use this id with its internal authorization config file.
    Using ssh is a good way to do that (since the name of the public key registered in Gitolite will be used as your id name)

    So:

    • you need to make sure _www user is authorized to push to your repo
    • you need to have a public/private key under ~_www/.ssh to be used by your push
    • you need to add the public key of _www user to gitolite keys.

    The OP enovav comments that:

    • On Lion Server, the _www user does not have a home folder.
    • PHP looks for SSH keys in /Library/WebServer.
    • It is not possible by default to log in to the _www user, however this thread explains how. (chsh -u Admin _www to change the shell from /bin/false).
    • The steps can then be followed as above.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题