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
相关推荐
qianmoQ1 天前
GitHub 趋势日报 (2025年05月14日)
github
Yvonne爱编码1 天前
CSS- 2.1 实战之图文混排、表格、表单
前端·css·html·github·状态模式·html5·hbuilder
qianmoQ2 天前
GitHub 趋势日报 (2025年05月11日)
github
Yvonne爱编码2 天前
HTML-3.3 表格布局(学校官网简易布局实例)
前端·html·github·html5·hbuilder
范纹杉想快点毕业2 天前
以项目的方式学QT开发(一)——超详细讲解(120000多字详细讲解,涵盖qt大量知识)逐步更新!
c语言·数据结构·c++·git·qt·链表·github
tonngw2 天前
【Mac 从 0 到 1 保姆级配置教程 12】- 安装配置万能的编辑器 VSCode 以及常用插件
git·vscode·后端·macos·开源·编辑器·github
八股文领域大手子2 天前
HTTP/1.1 host虚拟主机详解
github
HORSE RUNNING WILD2 天前
解决 PicGo 上传 GitHub图床及Marp中Github图片编译常见难题指南
css·python·github
qianmoQ2 天前
GitHub 趋势日报 (2025年05月13日)
github
lkbhua莱克瓦242 天前
用C语言实现了——一个基于顺序表的插入排序演示系统
c语言·开发语言·数据结构·程序人生·github·排序算法·交互