Warning: Permanently added the RSA host key for IP address '13.229.xxx.xxx' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git@github.com: Permission denied (publickey).
The authenticity of host 'github.com (xx.xx.xx.xx)' can't be established.
RSA key fingerprint is xx.xx.xx.xx.xx.
Are you sure you want to continue connecting (yes/no)?
$ ssh-keygen -t rsa -C "376057520@qq.com"
Generating public/private rsa key pair.
Enter file inwhich to save the key (/Users/qinzhen/.ssh/id_rsa):
/Users/qinzhen/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/qinzhen/.ssh/id_rsa.
Your public key has been saved in /Users/qinzhen/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ZBT2CZADZ5s1/BhVCMP8WY9y14OOgy8juOKsJ0Rf0zE 376057520@qq.com
The key's randomart image is:
+---[RSA 2048]----+
| ..+*X+.o. |
| ooE==... |
| +.==oo o.. |
| . o +. = o.o..|
|. . . . S .oo. .|
| . . . o . |
|. . . . |
| ..o . . o . |
| .=o... . o |
+----[SHA256]-----+
-u, --set-upstream
For every branch that is up to date or successfully pushed, add
upstream (tracking) reference, used by argument-less git-pull(1) and
other commands. For more
information, see branch.<name>.merge in git-config(1).
==补充小技巧==:在提交文件的时候我们如果有多个文件修改,可以使用git commit -a -m "修改描述"命令将当前修改全部加到add中一起commit;
这时候刷新GitHub的页面可以看到本地仓库的文件已经成功被提交到了GitHub上:
注意:
在第一次使用git进行push或者clone的时候,会出现警告选择提示:
The authenticity of host 'github.com (xx.xx.xx.xx)' can't be established.
RSA key fingerprint is xx.xx.xx.xx.xx.
Are you sure you want to continue connecting (yes/no)?
提示我们当前GitHub的鉴权没有被建立,是否继续连接,选择“yes”得到以下提示信息:
Warning: Permanently added 'github.com' (RSA) to the list of known hosts.