git官网下载地址:https://git-scm.com/downloads自己进去找对应的版本
git中用户名及邮箱的设定
git config --global user.name "用户名"
git config --global user.name "用户邮箱"
cd ~/.ssh` # 进入到~./ssh中 如果显示No such file or directory 则进行下一步 否则直接跳过下一步
mkdie ~/.ssh
cd ~/.ssh
生成RSA摘要 在git 与 GitHub 之间建立链接
$ ssh-keygen -t rsa -C "用户邮箱" ----这个是命令
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/axing/.ssh/id_rsa): # 回车即可
Enter passphrase (empty for no passphrase): # 回车即可
Enter same passphrase again: # 回车即可
Your identification has been saved in /c/Users/axing/.ssh/id_rsa
Your public key has been saved in /c/Users/axing/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:OU9e2+vM546g/HZ1w6t3i5yh+PtRkZhrHtxzoY+e5q8 用户邮箱
The key's randomart image is:
+---[RSA 3072]----+
| |
| o .|
| o + |
| . . + o|
| S . .*.+.|
| = .oo=o=|
| o o=.o+|
| ...==B=o|
| .+**E@*=|
+----[SHA256]-----+
去GitHub中-------以下看图
上面的操作完成后,再回到Git Bash 命令框
$ ssh git@github.com # 与github.com 建立来连接
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
PTY allocation request failed on channel 0
Hi 用户! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
注意上面的命令是在 ~/.ssh 中敲的,还有用户名 用户邮箱没有必要较真 瞎写点就好如果非要认真也没错。
接下来到pycharm中进行设定—见下图
打完 收工
以上仅仅为自己的实践记录,对内部理解不是很到位,欢迎交流、指正!