centos配置git webhook
linux 版本控制 git 配置 webhooklinux 使用www 用户生成秘钥码云(git)部署公钥linux 使用www 用户初始化gitphp hook代码linux 使用www 用户生成秘钥sudo -u www ssh-keygen生成公钥:/home/www/.ssh/id_rsa.pub码云(git)部署公钥把第一步创建的公钥:/home/www/.ssh/id_rsa.pub
·
linux 版本控制 git 配置 webhook
linux 使用www 用户生成秘钥
sudo -u www ssh-keygen -t rsa -C "邮箱"
生成公钥:/home/www/.ssh/id_rsa.pub
设置邮箱和用户名
sudo -Hu www git config --global user.email " 邮箱"
sudo -Hu www git config --global user.name "昵称"
码云(git)部署公钥
把第一步创建的公钥:/home/www/.ssh/id_rsa.pub,添加到码云
linux 使用www 用户初始化git
su -u www git init
添加ssh仓库地址:
su -u www git remote add origin git@gitee.com:ceshi/ceshi_com.git
git pull测试
sudo -Hu www git pull -f origin master
php hook代码
$cmd = "cd {$target} && git reset --hard && git pull origin master ";
$info=shell_exec($cmd);
更多推荐
已为社区贡献1条内容
所有评论(0)