Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用vpn后无法git push到自己的仓库——解决方法 #62

Open
sherryt63 opened this issue Jan 19, 2024 · 1 comment
Open

使用vpn后无法git push到自己的仓库——解决方法 #62

sherryt63 opened this issue Jan 19, 2024 · 1 comment

Comments

@sherryt63
Copy link

最近在上传期末作业至github的个人仓库时发现git add,git commit指令都可以实现,唯独到了最后的git push阶段会出现报错,如下所示:
image
本来以为是网络信号差的原因,但连着试了两天都有这个问题。查询网上论坛解答,猜测是由于自己连了vpn但没有给git bash设置vpn的代理所导致的。

解决步骤如下:
在git bash上依次输入:
①git config --global --unset https.proxy
②vim ~/.gitconfig
③会进入到如下页面(原先没有https及其下面的语句),需要手动配置https内容,如下图所示:
image
上面的proxy后面内容是vpn的https代理服务器编号(我的是形如xxx.x.x.x:xxxxx)

接着再重新git push origin main就可以成功上传文件至个人仓库啦~

@sherryt63
Copy link
Author

发现图2粘贴错了,更正如下:
160656249487260a2f7096f317d5178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant