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想发布的仓库已经授权了公钥,比如github的ssh,你可以把A的公钥授权到A仓库和B仓库,仓库肯定是可以授权多个公钥的。

bash 复制代码
[user]
	name = *****
	email = *****
	password = ****
[credential]
	helper = manager-core
相关推荐
阿智的AI开发笔记3 小时前
充了 200 块只跑出 3 条:AI 视频真正贵的地方,是「按次」和「按秒」的区别
github
GitHub实测笔记3 小时前
rtk 本机实测:给 AI Agent 砍掉 90% 的命令行噪音(Linux)
github
小莫4613 小时前
CI 全绿了,测试却可能是假的:GitHub Actions 三个静默失效的坑
github
dreams_dream5 小时前
项目想要推送多个平台仓库的方法
gitee·github
AI_Lab015 小时前
服务器管理工具要在服务器上装 Agent,安全吗?
服务器·安全·github
七牛云行业应用5 小时前
DeepSeek Harness 插件架构 vs MCP:Cordis 的「Everything is a Plugin」到底解决什么
ai·github·ai编程
u1301306 小时前
GitHub 热榜项目:日榜(2026-10-30)
人工智能·github
AlfredZhao7 小时前
新项目首次提交 GitHub 报错“未配置远端 origin”怎么办
github
miofly7 小时前
GitHub 日榜趋势速报 | 2026-10-31
开源·github
u13013018 小时前
GitHub 热榜项目:日榜(2026-10-29)
人工智能·github