1. 当前虚拟站点根目录的 .git/ 权限
2. 当前项目裸仓库创建 hooks/post-receive 文件,并给予x 的权限
3. 复制如下内容
#!/bin/shunset $(git rev-parse --local-env-vars)REPO="git@123.111.11.11:edc2.git"#BRANCH=`echo $refname | sed -n 's/^refs\/heads\///p'`#BRANCH_DIR="/root"SSH_DEST="root@iZ255rhjhjhjhjhjhjt7otpZ"ssh "$SSH_DEST" /bin/sh <<-EOFcd /alidata/www/v2.edc.comgit pull origin masterEOF
*******************
可能有如下问题
su - git
ssh-keygenssh-copy-id michael@docker.example.comssh michael@docker.example.com
http://stackoverflow.com/questions/37455781/gitlab-post-receive-hook-host-key-verification-failed