- 安装GIT.
sudo apt update
sudo apt install git
-
安装完之后需要进行账号配对。以后在每一次推拉代码的时候都会访问你的账户名和邮箱信息。
git config --global user.name "Your Name" git config --global user.email "youremail@yourdomain.com"
- 通过命令
git config --list
查看,此信息被存储在~/.gitconfig
中。
- 通过命令
-
接下来需要配置SSH,不然不能下载,并且大文件传输稳定。
ssh-keygen -t rsa -C "youremail@yourdomain.com"
- 多次按回车,直到出现keys randomart image 。生成的密钥保存在
~/.ssh/id_rsa.pub
。
- 多次按回车,直到出现keys randomart image 。生成的密钥保存在
-
把生成的密钥放在GitHub里面的,并添加就OK了.