git push, pull, clone with no response

2019-08-31 23:16发布

问题:

When I run git push, pull, clone none of them works.

I get following error when i'm trying to push or pull or clone a repository

fatal: unable to access 'https://github.com/myUsername/myRepo/': Operation timed out after 0 milliseconds with 0 out of 0 bytes received

What can cause such an issue? Where and what should I check to find out what is causing this problem?

回答1:

You are cloning the wrong url. Git repo urls are in the form of:

https://github.com/username/repository.git

With that url you are trying to clone the repository public (or private, depending on your account) front page.



回答2:

It should be some thing like below:

git clone https://github.com/myUsername/myRepo.git


回答3:

According this link, When switching branches and doing a submodule update git sometimes messes up the submodule status without you having touched it.

So following codes fixes the issue

git submodule init
git submodule update


标签: linux git