Ubuntu中搭建git
1、配置用户名和邮箱
git config --global user.name "xiaoming"
git config --global user.email "xxxx@example.com"
2、生成ssh-rsa密钥(公钥和私钥)
ssh-keygen -t rsa -C "xxxx@example.com"
3、登陆Github,添加ssh公钥文件。
- 在settings -> SSH and GPG keys里添加公钥。具体方法为 将id_rsa.pub的内容复制过来。
4、测试与github的连接
ssh -T git@github.com
输入yes,连接成功。

更多精彩