• 创建ssh公钥和私钥 (最好保存到默认位置, 不然一会儿使用私钥的时候还是从默认位置读取的)
ssh-keygen -m PEM -t rsa -b 4096 -C "website@admin.com"
一路回车就好了
  • 默认公钥和私钥存储于用户家目录 .ssh目录下
[root@localhost .ssh]# pwd
/root/.ssh
[root@localhost .ssh]# ls -la
总用量 28
drwx------. 2 root root    81 7月   7 06:29 .
dr-xr-x---. 7 root root  4096 7月   7 06:20 ..
-rw-------. 1 root root  3243 7月   7 06:29 id_rsa
-rw-r--r--. 1 root root   742 7月   7 06:29 id_rsa.pub
  • 配置代码仓库设置
一般在代码仓库, 设置, 部署公钥 下面

然后就可以愉快的克隆啦


如果是服务端测服正服需要使用一样的发布

拷贝正服的 ~/.ssh/id_rsa,id_rsa.pub 到测服该目录
执行
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
git config --global user.email fabu@qq.com
git config --global user.name fabu
同样的git配置完成

标签: none

添加新评论