github问题解决(持续更新中)

1、ssh: connect to host github.com port 22: Connection refused

从.ssh文件夹中新建文件名为config,内容为:

bash 复制代码
Host github.com
Hostname ssh.github.com
Port 443

2、解决 git 多用户提交切换问题

使用系统命令ssh创建rsa公私秘钥

bash 复制代码
C:\Users\fyp01> ssh-keygen -t ras -b 4096 -C "${邮箱}"
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\fyp01/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\fyp01/.ssh/id_rsa.
Your public key has been saved in C:\Users\fyp01/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:4JRe/U5MvaLkh2sCPEHUvK1RBQr9zTB8y338T77ZliE ********
The key's randomart image is:
+---[RSA 4096]----+
|     .o+ ..o.    |
|      .o+o= ..   |
|     .+ o=.B.o.. |
|     +.oo o+= ..o|
|     .o.So. = ...|
|      + .o = E .o|
|       o  + o .o+|
|        . .o   .*|
|         o.    +o|
+----[SHA256]-----+

生成完后,将生成的文件重命名

c:/Users/${用户名}/.ssh/目录下

创建config文件并编辑

bash 复制代码
Host github.com
Hostname ssh.github.com
Port 443
User fyupeng
IdentityFile /C/Users/fyp01/.ssh/id_rsa_fyupeng

Host github.com
Hostname ssh.github.com
Port 443
User fyupeng-rnf
IdentityFile /C/Users/fyp01/.ssh/id_rsa_rnf

后面如果你想用A用户去发布A用户仓库,那只要在config文件上保留A,使用'#注释B的,然后在
C:\Users\f${}用户名\.gitconfig文件中,更改当前用户为A,当然也可以用A发布到B用户仓库,看个人习惯。

发布的前提是A想发布的仓库已经授权了公钥,比如githubssh,你可以把A的公钥授权到A仓库和B仓库,仓库肯定是可以授权多个公钥的。

bash 复制代码
[user]
	name = *****
	email = *****
	password = ****
[credential]
	helper = manager-core
相关推荐
全栈小59 小时前
【代码管理】在本地使用github和gitee之后,可能存在冲突,导致再次提交代码时提示Couldn‘t connect to server
gitee·github·代码管理工具
NocoBase10 小时前
11 个在 GitHub 上最受欢迎的开源无代码 AI 工具
低代码·ai·开源·github·无代码·ai agent·airtable·内部工具·app builder
今禾11 小时前
Git完全指南(中篇):GitHub团队协作实战
前端·git·github
whysqwhw11 小时前
KuiklyUI利用Kotlin Lambda函数实现声明式UI系统的深入分析
github
whysqwhw11 小时前
Kotlin扩展函数和带接收者的 Lambda 表达式实现DSL
github
天一生水water11 小时前
Failed to connect to github.com port 443
github
绝无仅有12 小时前
百度面试题解析:微服务架构、Dubbo、Redis及其一致性问题(一)
后端·面试·github
绝无仅有12 小时前
百度面试题解析:Zookeeper、ArrayList、生产者消费者模型及多线程(二)
后端·面试·github
HelloGitHub12 小时前
DIY ChatGPT 一周狂揽 27k Star「GitHub 热点速览」
开源·github
星依网络15 小时前
棋牌网站管理后台嗅探查找方法(2025最新)
github