Git http url的网络连接改进

通过作者一天的验证,以下方法治标不治本,最终转为ssh上传,请认真甄别

1.修改hosts文件
140.82.113.4(图1的IP Address) github.com 
199.232.69.194(图2的IP Address) github.global.ssl.fastly.net
185.199.108.153(图3的IP Address)  assets-cdn.github.com
185.199.109.153(图3的IP Address)  assets-cdn.github.com
185.199.110.153(图3的IP Address)  assets-cdn.github.com
185.199.111.153(图3的IP Address)  assets-cdn.github.com
写最后保存

sudo killall -HUP mDNSResponder;say DNS cache has been flushed
刷新DNS需要权限
window系统刷新DNS解析缓存 ipconfig /flushdns

2.改DNS114.114.114.114
ssh的443端口连接报错,改DNS后出现port22报错
~/ssh下方的文件全部删除

// 使用命令行,看下ssh 和 git链接的连接情况
ssh -T git@github.com

注意配置config
Host github.com
User hellojue@foxmail.com(即自己的用户名)
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
继续执行ssh -T git@github.com查看连接建立
成功后ssh-keygen -t ed25519 -C "用户名"执行ssh的私钥和公钥配置
最后把把c:/Users/AlexYi/.ssh/id_rsa.pub,公钥拿到github上配置

3.取消全局代理
git config --global --unset http.proxy
 
git config --global --unset https.proxy

---------------------------------------------------------------------------------------------------------------------------------

Q1:fatal: unable to access 'https://github.com/huang328/bustub-private/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
window系统刷新DNS解析缓存 ipconfig /flushdns

Q2:fatal: refusing to merge unrelated histories
git pull origin master --allow-unrelated-histories

Q3:To github.com:***/***
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘git@github.com:***/***’
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.

远程repository与本地的repository有冲突,分布传输
$ git pull origin master
$ git push origin master

或创建新分支再push
$ git branch [name]
$ git push origin [name]

Q4:error: unknown option `allow-unrelated-histories'
usage: git push [<options>] [<repository> [<refspec>...]]

未解决,遂放弃

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值