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 "your_email@example.com" 或者從gitlab頁面添加 添加到/var/opt/gitlab/.ssh/authorized_keys 不行再用絕對路徑 而後git clonegit

注意git ssh 端口用的是22

git clone git@192.168.163.175:root/test.git ------------- http://127.0.0.1:8001/root/showdoc.gitshell

相關文章
相關標籤/搜索