github配置

Posted LinXiaoshu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了github配置相关的知识,希望对你有一定的参考价值。

如何与github相连

shell中输入

ssh-keygen -t rsa -C "youremail"

连续回车,成功后提示 our identification has been saved in xxx

进入github,添加密钥.随后在本地shell进行验证:

ssh -T git@github.com

可能在此之前要进行:

ssh-add id_rsa

然后在已经init的目录下

git remote add origin git@github.com:username/reponame.git

这个指令的含义是:将远程的repo在本地称为origin.

提交时使用(其中前者为远程分支名,后者为本地分支名.)

git push -u origin main

20230327更新

今天想提交一下做的minilisp,又是老问题无法链接github.

照上述方法重新生成,居然不行!
powershell报错

(base) PS C:\\Users\\xxx> ssh -T git@github.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in C:\\\\Users\\\\gdx/.ssh/known_hosts to get rid of this message.
Offending RSA key in C:\\\\Users\\\\gdx/.ssh/known_hosts:1
RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.

经查找,在这里找到了原因,即3月23日,github更新了他们服务器的ssh host key.NMD!
按照网站说的,执行

ssh-keygen -R github.com

即在/.ssh/known_hosts中移除原有github key,并手动添加

github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=

即可.

以上是关于github配置的主要内容,如果未能解决你的问题,请参考以下文章

github上传了配置信息

史上最新版GitHub+Hexo配置系列教程-GitHub配置

如何在本地环境配置github

github网络访问配置

iOS 本地项目上传github,github管理项目配置

开发环境PyCharm 配置 GitHub ( 在 PyCharm 中向 GitHub 提交代码 )