安装
Centos--yum安装:yum install git
mac-----brew安装:brew install git
git version 验证安装是否成功
git初始化设置
git config --global user.name "laowang666" 设置用户名
git config --global user.email "laowang666abc.com" 设置email
生成认证证书
ssh-keygen -t rsa -C "laowang666abc.com" 生成证书
cd ~/.ssh/ id_rsa id_rsa.pub 公钥、私钥
登录github,点击头像--setting--SSH and GPG keys--new SSH keys--title 随便写--回到本地打开 id_rsa.pub,复制,粘贴到 key
回到本地,验证是否连接正确
本地:ssh git@github.com
git ssh 22 端口不可用时通过https 443 端口配置git ssh
Contos服务器 ssh -vT -p 443 git@ssh.github.com
To set this in your ssh config, edit the file at ~/.ssh/config, and add this section:
Host github.com Hostname ssh.github.com Port 443
Github 简明教程