【问题标题】:Git push hangs when pushing to Github?推送到 Github 时 Git 推送挂起?
【发布时间】:2023-12-25 02:01:01
【问题描述】:

每次我尝试推送到 github 时,Git push 都会挂起。我正在使用 Cygwin 和 Windows 7。 Git 在本地跟踪分支、提供状态、设置全局 user.name 和 user.email 以及允许提交的功能很好。

我还是新手,还在学习。

我输入 git pushgit push origin mastergit push -u origin master ,我只得到一个空白行,要求我按 ctl-c 来获取提示。

ssh-keygen -t rsa -C "me@example.com" 向我询问文件名并挂起

git push heroku master 挂起

$ git status 返回On branch master nothing to commit, working directory clean

$ git pull 返回Already up to date

$ git remote -v 返回:

heroku  git@heroku.com:myherokusite.git (fetch)

heroku  git@heroku.com:myherokusite.git (push) origin  

https://github.com/gitusername/appname.git (fetch) origin  

https://github.com/gitusername/appname.git (push)

or the correct ssh remote settings are returned when trying this with ssh

更新:使用 SSH url git@github.com:gitusername/gitrepo.git 也会挂起

git remote set-url origin https://github.com/gitusername/appname.git 是正确的

更新:当它挂起时,我可以看到在 Windows 任务管理器中运行的 git 进程。

我试过了:

使用不同的互联网连接位置

在 https 和 ssh 之间切换会挂起

已卸载 git。重装自:https://code.google.com/p/msysgit/downloads/list

已卸载 git。安装 Cygwin 的 git

已卸载 git。安装了 Github for Windows GUI 应用程序,我可以推送它。但是这个应用程序的功能有限,迫使我离开我的 Cygwin 窗口进入另一个应用程序,然后迫使我进入 Windows 命令提示符以获得完整的功能,我认为我已经通过使用 Cygwin 逃脱了。

花了很多很多时间试图解决这个问题,之前它工作正常,谢谢。

更新 4/2014:我重建了我的整个机器 Win 7、Cygwin 等,现在一切正常

【问题讨论】:

  • 您是在防火墙后面还是在代理后面?
  • 我尝试了不同的互联网连接但没有成功,是的,我有以前从未引起过问题的防病毒软件。没有代理。
  • 运气好吗?我在 cygwin 上遇到了同样的问题。修复:但是,如果我使用本机 Windows shell (cmd.exe),git push origin master 可以正常工作。
  • 对我来说重启电脑有帮助。
  • 我不得不退出 VPN。

标签: git github cygwin freeze git-push


【解决方案1】:
git config --global core.askpass "git-gui--askpass"

这对我有用。提示可能需要 3-5 秒才会出现,只需输入您的登录凭据即可。

【讨论】:

  • 我跑了这个,现在它一直说error: cannot run git-gui--askpass: No such file or directory,你能告诉我如何扭转这个问题吗?
  • @hello_there_andy this 可以帮助你。
  • 这条线对我没有任何作用。空输出。
  • 运行此行后,问题没有解决,现在推送时,git一直说error: cannot run git-gui--askpass: No such file or directory。 @forloop 添加的解决方案帮助我扭转了它。
  • 对我来说工作得很好。我什至不必输入任何凭据。