gitlab 钩子

钩子

cd /var/opt/gitlab/git-data/repositories/root/test.git/  
有软链接的话,先删除
rm -rf hooks
### 注意不是
rm -rf hooks/
mkdir hooks
cd hooks
ln -s /opt/gitlab/embedded/service/gitlab-shell/hooks/pre-receive pre-receive
ln -s /opt/gitlab/embedded/service/gitlab-shell/hooks/update update
上传post-receive
chown git:git hooks
chmod 777 -R hooks

key

用key ssh-keygen -t rsa -C "[email protected]" 或者从gitlab页面添加 添加到/var/opt/gitlab/.ssh/authorized_keys 不行再用绝对路径 然后git clone

注意git ssh 端口用的是22

git clone [email protected]:root/test.git ------------- http://127.0.0.1:8001/root/showdoc.git

猜你喜欢

转载自my.oschina.net/u/3004226/blog/1592097