网站首页 > 文章精选 正文
“干干干,了呀,拉代码不行了”,这是我昨天的第一反应。一开始我以为是我网络不好,我换了4g,然后不行,再然后我以为是我没有开代理,于是我开代理在改git配置,结果还是炸的。甚至测试服务器也是有问题。
好家伙,我知道不是我个人的问题了,然后我去搜了一下,确实发现11月-12月有人一样的问题。看来,是上面有动作了。那好,我们就根据网友的智慧来处理问题。
修改ssh配置
mac、linux、window(用git bash)的直接修改或创建。
vim ~/.ssh/config
Host github.com
#HostName github.com
#Hostname 20.205.243.166
Hostname ssh.github.com
User git
IdentityFile ~/.ssh/id_rsa
Port 443
Host github2
#HostName github.com
#Hostname 20.205.243.166
Hostname ssh.github.com
User git
IdentityFile ~/.ssh/id_rsa_2
Port 443
验证是否可以
ssh -T git@github.com
# 输出一下内容就成功
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
一个环境如何玩转两个github号并开发提交不同项目
最近搞了两个git号来玩,不同号提交代码是一个问题,因为仓库权限不一样。于是也找了方案,分享给你们:
本来已经有个ssh key了,现在我们再加一个新github号:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
好,现在新号有了,我们也设置到GitHub上去了。接下来就是拉新号的项目,假设是aaa这个项目。
git clone git@github.com:xxx/aaa
接下来,我们就又会用到ssh config,编辑config,然后再加一个配置。
Host github-aaa
Hostname ssh.github.com
User git
IdentityFile ~/.ssh/id_rsa_aaa
Port 443
最后,我们要改项目的仓库地址了,先删除在新增。我们新增的重点是:`git@{host}`,这里的host就要对应上面ssh config 的配置。
git remote remove origin
git remote add origin git@github-aaa.com:xxx/aaa
git代理常用指令
设置代理
//http || https
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890
//sock5代理
git config --global http.proxy socks5 127.0.0.1:7891
git config --global https.proxy socks5 127.0.0.1:7891
查看代理
git config --global --get http.proxy
git config --global --get https.proxy
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
猜你喜欢
- 2025-01-18 常见的nVidia显卡问题及其解决方法
- 2025-01-18 GitHub正式登录Android和iOS!随时随地看代码合并pull请求
- 2025-01-18 GitHub 加速下载,从此摆脱下载慢的折磨
- 2025-01-18 新手小白Github够用教程(必备)
- 2025-01-18 解决github下载慢的问题
- 2025-01-18 一定要学会的Github技巧!找项目、可不止加速这么简单
- 2025-01-18 github the remote end hung up unexpectedly 的解决办法
- 2025-01-18 Python代码运行报错怎么办?
- 2025-01-18 只因员工在伊朗打开了电脑,GitHub把整个公司账号冻结了
- 2025-01-18 微软修复Win10无法卸载/更新Teams应用问题
- 最近发表
- 标签列表
-
- newcoder (56)
- 字符串的长度是指 (45)
- drawcontours()参数说明 (60)
- unsignedshortint (59)
- postman并发请求 (47)
- python列表删除 (50)
- 左程云什么水平 (56)
- 计算机网络的拓扑结构是指() (45)
- 稳压管的稳压区是工作在什么区 (45)
- 编程题 (64)
- postgresql默认端口 (66)
- 数据库的概念模型独立于 (48)
- 产生系统死锁的原因可能是由于 (51)
- 数据库中只存放视图的 (62)
- 在vi中退出不保存的命令是 (53)
- 哪个命令可以将普通用户转换成超级用户 (49)
- noscript标签的作用 (48)
- 联合利华网申 (49)
- swagger和postman (46)
- 结构化程序设计主要强调 (53)
- 172.1 (57)
- apipostwebsocket (47)
- 唯品会后台 (61)
- 简历助手 (56)
- offshow (61)