Git 学习笔记:连接到 Github
一、配置用户信息和 ssh key 配置 user.email 以及 user.name:
|
1 2 |
git config --global user.name "maqian" |
生成公私密钥:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): # 文件的生成目录 Created directory "/root/.ssh". Enter passphrase (empty for no passphrase): # 密码,可以为空 Enter same passphrase again: # 确认密码 Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: c2:4f:68:c6:14:8a:20:cf:78:72:a4:23:df:f7:cb:5c maqian@dyxmq.cn The key"s randomart image is: +--[ RSA 2048]----+ |o . . | |.B . . . | |* * . . | |.* . + . | | . . O S | | + = | | o E | | o o | | + | +-----------------+ |
二、上传密钥到 github 上面生成了两个密钥文件,默认位于~/.s ... 阅读更多