1.注册github帐号
注册操作就不说了。
2.安装git
执行:
sudo apt-get install git
git --version
3.配置参数
git config --global user.name "name" //配置用户名
git config --global user.email "email" //配置email
git config --list //查看配置 信息
创建公钥,输入:
ssh-keygen -t rsa -C "email"
连按三次回车,得到密钥:
+---[RSA 2048]----+
| |
| . . |
| . . . + |
| . + . . = |
| S E + = o|
| + * = = B |
| ....+ = = B|
| ooo..+ . @.|
| o=. o=o +oB|
+----[SHA256]-----+
执行,在setting里选择SSH and GPG keys,titile随便起,将结果复制到keys里面,然后确定。
cat ~/.ssh/id_rsa.pub
验证一下:
ssh -v git@github.com
结果如下表示成功:
Hi RoseGavinbill! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Connection to github.com closed.
Transferred: sent 3476, received 2256 bytes, in 1.3 seconds
Bytes per second: sent 2691.2, received 1746.6
debug1: Exit status 1