Search code examples
gitwififetchpull

Git fetch/pull only work when connected to a specific wifi?


I've cloned a Git repository a few days back and began working on it, all the while on a wifi connection we'll call wifi_a.

Sometimes, wifi_a is unresponsive, but wifi_b generally works when wifi_a doesn't. So, some days I use wifi_b instead. Today was one of those days.

I decided I wanted to fetch recent updates utilizing the upstream remote. However, fetch just hung there. I then decided to try a pull. Nothing. All I got, after sitting here for minutes, was:

fatal: unable to connect to github.com:
github.com[0: 207.97.227.239]: errno=Operation timed out

So, out of curiosity, I checked to see if wifi_a worked again. It did! So, I switched back to wifi_a. I tried the git fetch again and it worked instantly!

My question now is.. why? Why can't I be on a different wifi connection? I was able to use my web browser while connected to wifi_b while I waiting for git to either finish the fetch or time out, so it's not that I wasn't connected. I just find this behavior strange, and any explanation would really help. After all, if I ever need to do some work but wifi_a is down, I'm hosed!


Solution

  • I'm still unsure why wifi_b isn't working. The University owns before connections, but wifi_b isn't secured by any password. My only guess is that since I created the fork using wifi_a, it only let's me do things with it while on wifi_a.