通过作者一天的验证,以下方法治标不治本,最终转为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>...]]
未解决,遂放弃