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
相关推荐
患得患失94932 分钟前
【GitHub Workflows 基础(一)】认识 .github/workflows/ 下的多个工作流
github
木人舟1 小时前
github copilot接入openai-compatible模型以及去除安全限制的方法
github·copilot
五岁小孩2 小时前
一次性解决Github Enable two-factor authentication
github·2fa
guiyanakaung6 小时前
CMP 如何优雅的实现跨软件的拖拽功能
前端·github
HelloGitHub10 小时前
开源新旗舰 GLM-4.5:不想刷榜,只想干活儿
人工智能·开源·github
星际码仔11 小时前
Zread 和 DeepWiki 怎么选?一张图全搞懂
github·chatglm (智谱)
DogDaoDao11 小时前
GitHub开源项目Zerox:AI驱动的OCR革命
人工智能·深度学习·开源·github·ocr·图像识别·zerox
Albert_Lsk12 小时前
【2025/07/28】GitHub 今日热门项目
人工智能·开源·github·开源协议
C++ 老炮儿的技术栈1 天前
在 Scintilla 中为 Squirrel 语言设置语法解析器的方法
linux·运维·c++·git·ubuntu·github·visual studio
油泼辣子多加1 天前
2025年07月25日Github流行趋势
github