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
相关推荐
想你依然心痛4 小时前
我的第一个开源项目:从0到1,我在GitHub写下的成长印记
开源·github
查老师7 小时前
人在上班,突然被开源社区用户点名不要脸?我想问你,你给我刷过几个子儿?
后端·开源·github
lpfasd1238 小时前
当 GitHub 宕机时,我们如何协作?
github
放飞自我的Coder10 小时前
【github-action 如何为github action设置secrets/environment】
github·action
绝无仅有11 小时前
编写 Go 项目的 Dockerfile 文件及生成 Docker 镜像
后端·面试·github
绝无仅有11 小时前
使用 Docker 部署 Go 项目(Beego 框架)
后端·面试·github
星哥说事12 小时前
开源轻量级表格革命——用Teable解锁你的数据管理新姿势
github
悟空聊架构13 小时前
从 0 到 1:Jenkins 对接企微机器人避坑指南(附可下载 Pipeline 模板)
后端·架构·github
HelloGitHub13 小时前
直击痛点的开源项目「GitHub 热点速览」
开源·github
超级小忍1 天前
深入解析 GitHub Actions 工作流文件编写:从入门到实战
github