0

If I try to do a git pull or push it hangs. The only way to go out of it is with ctrl-c. The other git functions seems to work. I have tried to do git reset --hard origin/master but that didn't work. I am using a remote WSL in VSCode. I have git version 2.25.1. I used an https URL. I am using a remote server namely github.

Anyone an idea of how to fix this?

Diede
  • 1
  • 1
  • 1
    "Anyone an idea of how to fix this?" Not without more details: OS? git version? URL used? (HTTPS or SSH?) Remote server? (github, gitlab, private server)? – VonC Nov 11 '21 at 13:32
  • https://stackoverflow.com/a/68057563/7976758 ? – phd Nov 11 '21 at 13:37
  • If you run `git pull` or `git push` or `git fetch`, you are using a URL. You may have the URL stored under the name of a *remote* like `origin` (in fact, you *should* do that), but there's still a URL: `git remote -v` will show it. – torek Nov 11 '21 at 15:31

1 Answers1

1

Since you're into the WSL, the problem might be that git is not able to reach GitHub.

WSL is often affected by this kind of "no-network" issue (mostly due to antivirus or firewalls blocking connections from WSL). This exact scenario happened to me as well.

Into the VSCode terminal, connected to WSL, you can test GitHub is reachable:

ping github.com

If it is reachable, another cause of your problem might be a typo in the git HTTPS URL.

Check those of your git repo by:

git remote -v
nyxgear
  • 99
  • 1
  • 5
  • Oh dear god... my wifi was the culprit. ipv4 worked along with the browser but bitbucket resolved to ipv6 address, which for some reason didn't. I simply had to restart the wifi connection and it worked. Thanks! – Leonidas A Nov 23 '22 at 16:38