问题
i used git before without any problem, but suddenly i can't push or clone anything.
when i use this command, just nothing happens, not even an error, so i have to press ctrl + c or just close git window.
i use this simple command for pushing:
git push origin master
also tried with -u parameter.
- i opened port 22 in my firewall, no luck
- i use both http and ssh, again no luck
- i install a new version of git, no luck
so what i can do to solve this?
Update:
i installed a fresh win xp on virtual machine and test to push something, same result as before, so may be my internet connection have some problem.
any idea?
回答1:
First, there was some issue with ssh access recently:
We are currently investigating SSH access problems on one of our fileserver pairs. A small number of repositories may be affected.
Second, you would need to try and use https, not http:
git remote set-url origin https://github.com/username/reponame
Third, the git push -u origin master
is only for the first push (after that, git push
alone is enough: see "Why do I need to explicitly push a new branch?" for more)
If the push or clone issue still persists, then you need to contact GitHub support to know more about this.
回答2:
Add
git remote set-url "https://github.com/targetusername/targetrepo"
after
git remote add "https://github.com/targetusername/targetrepo"
and before
git push -u origin master
回答3:
I had messed with multiple repositories and for some reason, the force argument solved the problem.
git push --force origin master
回答4:
Just wanted to contribute yet another reason this can happen: if the remote you're pushing to has IP filters in place, it will blink with no output. In my case, my laptop was connected with WiFi which was not connecting through a whitelisted IP address.
来源:https://stackoverflow.com/questions/17129751/stuck-at-push-nothing-happens