一、安装git
# 更新
sudo apt-get update -y
sudo apt-get upgrade -y
# 安装git
sudo apt-get install git -y
1、设定ssh文件
(1)加入用户的email、name等基本信息
git config --global user.name “zhangrenjie”
git config --global user.email “1273206268@qq.com”
(2)如果查找不到,.ssh目录,通过运行ssh-keygen程序创建SSH文件
ssh-keygen -t rsa -C “1273206268@qq.com”
# 接下来一路回车,不要设置密码,设置密码后期拉去、提交代码都得输入,麻烦
(3)查看ssh公钥
cat ~/.ssh/id_rsa.pub
(4)将ssh配置到github
三、其他问题
2、使用命令ssh -add时,Could not open a connection to your authentication agent
运行命令ssh-agent bash,再运行ssh-add