简体   繁体   English

Git 推或拉似乎没有响应

[英]Git push or pull doesn't seem to respond

If I try to do a git pull or push it hangs.如果我尝试做一个 git 拉或推它会挂起。 The only way to go out of it is with ctrl-c . go 的唯一方法是使用ctrl-c The other git functions seems to work.其他 git 功能似乎有效。 I have tried to do git reset --hard origin/master but that didn't work.我试过做git reset --hard origin/master但这没有用。 I am using a remote WSL in VSCode.我在 VSCode 中使用远程 WSL。 I have git version 2.25.1.我有 git 版本 2.25.1。 I used an https URL.我使用了 https URL。 I am using a remote server namely github.我正在使用远程服务器,即 github。

Anyone an idea of how to fix this?有人知道如何解决这个问题吗?

Since you're into the WSL, the problem might be that git is not able to reach GitHub.由于您进入了 WSL,问题可能是 git 无法访问 GitHub。

WSL is often affected by this kind of "no-network" issue (mostly due to antivirus or firewalls blocking connections from WSL). WSL 经常受到这种“无网络”问题的影响(主要是由于防病毒软件或防火墙阻止了来自 WSL 的连接)。 This exact scenario happened to me as well.这种确切的场景也发生在我身上。

Into the VSCode terminal, connected to WSL, you can test GitHub is reachable:进入VSCode终端,连接WSL,可以测试GitHub是否可达:

ping github.com

If it is reachable, another cause of your problem might be a typo in the git HTTPS URL.如果它是可访问的,则问题的另一个原因可能是 git HTTPS URL 中的拼写错误。

Check those of your git repo by:通过以下方式检查您的 git repo:

git remote -v

I disabled my antivirus and it worked.我禁用了我的防病毒软件,它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM