git push的替代方法
我有一个与ssh支持共享托pipe计划,我认为这将使git部署成为可能。
但是当我在本地调用git push
,它返回"fatal: protocol error: bad line length character"
经过几次search后,我发现问题出在了receive-pack
和ssh2docker
。 完整的错误是这样的:
debug1: Sending command: receive-pack /ftp/websites/website.com/www/ ssh2docker: exec is not yet implemented. https://github.com/moul/ssh2docker/issues/51. exec request failed on channel 0
我希望推送部署工作,以便当我推动回购它将部署站点在www目录。
/ftp/websites/website.com/repo/site.git /ftp/websites/website.com/www/
我使用这个post-receive hook:
#!/ bin / sh的 git --work-tree = / ftp / websites / website.com / www / --git-dir = / ftp / websites / website.com / repo / site.git checkout -f
有没有办法绕过git push
部署和replace是用别的东西? 我可以在服务器上做git clone
, pull
和fetch
,所以我可以以某种方式在服务器上设置git fetch来调用该钩子并部署网站?
谢谢!