git 卡在推送中,什么也没有发生

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17129751/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:38:58  来源:igfitidea点击:

Stuck at push, nothing happens

gitgithubgit-pushgit-clone

提问by mehdok

i used git before without any problem, but suddenly i can't pushor cloneanything. when i use this command, just nothing happens, not even an error, so i have to press ctrl + cor just close git window.
i use this simple command for pushing:

我之前使用 git 没有任何问题,但突然间我无法推送克隆任何东西。当我使用这个命令时,什么也没发生,甚至没有错误,所以我必须按ctrl + c或关闭 git 窗口。
我使用这个简单的命令进行推送:

git push origin master

also tried with -uparameter.

也试过-u参数。

  1. i opened port 22 in my firewall, no luck
  2. i use both http and ssh, again no luck
  3. i install a new version of git, no luck
  1. 我在防火墙中打开了端口 22,没有运气
  2. 我同时使用 http 和 ssh,再次没有运气
  3. 我安装了一个新版本的 git,不走运

so what i can do to solve this?

那么我能做些什么来解决这个问题?

Update:

更新:

i installed a fresh win xp on virtual machine and test to pushsomething, same result as before, so may be my internet connection have some problem.

我在虚拟机上安装了一个新的 win xp 并测试推送一些东西,结果和以前一样,所以可能是我的互联网连接有问题。

any idea?

任何的想法?

采纳答案by VonC

First, there was some issue with ssh access recently:

首先,最近ssh访问出现了一些问题:

We are currently investigating SSH access problems on one of our fileserver pairs. A small number of repositories may be affected.

我们目前正在调查我们的文件服务器对上的 SSH 访问问题。少数存储库可能会受到影响。

Second, you would need to try and use https, not http:

其次,您需要尝试使用 https,而不是 http:

git remote set-url origin https://github.com/username/reponame

Third, the git push -u origin masteris only for the first push (after that, git pushalone is enough: see "Why do I need to explicitly push a new branch?" for more)

第三,git push -u origin master仅用于第一次推送(之后,git push仅此一项就足够了:查看“为什么我需要显式推送一个新分支?”了解更多信息)

If the push or clone issue still persists, then you need to contact GitHub support to know more about this.

如果推送或克隆问题仍然存在,那么您需要联系 GitHub 支持以了解更多信息。

回答by MiloMinderbinder

Add

添加

git remote set-url "https://github.com/targetusername/targetrepo"

git remote set-url "https://github.com/targetusername/targetrepo"

after

git remote add "https://github.com/targetusername/targetrepo"

git remote add "https://github.com/targetusername/targetrepo"

and before

和之前

git push -u origin master

回答by Agnel Vishal

I had messed with multiple repositories and for some reason, the force argument solved the problem.

我弄乱了多个存储库,出于某种原因, force 参数解决了这个问题。

git push --force origin master

回答by C. Griffin

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.

只是想提供另一个可能发生这种情况的原因:如果您推送到的遥控器有 IP 过滤器,它会闪烁而没有输出。就我而言,我的笔记本电脑连接了 WiFi,但未通过列入白名单的 IP 地址连接。

回答by augusto

It maybe be related to yout ssh client. Can you ssh login the a remote server? The -vverbose option is very usefull here.

它可能与您的 ssh 客户端有关。你可以 ssh 登录远程服务器吗?在-v详细选项是非常有用的在这里。

ssh -v -p PORT USER@SERVER

More details here: https://stackoverflow.com/a/60205342/195812

更多细节在这里:https: //stackoverflow.com/a/60205342/195812