推送到 Github 时 Git 推送挂起? [英] Git push hangs when pushing to Github?

查看:39
本文介绍了推送到 Github 时 Git 推送挂起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Git push hangs everytime I try to push to github. I am using Cygwin and Windows 7. Git functions fine locally tracking branches, providing status, setting global user.name and user.email and allowing commits.

我还是个新手,正在学习中.

I'm still new and learning.

我输入 git pushgit push origin mastergit push -u origin master ,但我得到的只是一个需要我的空行到 ctl-c 以获取提示.

I enter git push , git push origin master or git push -u origin master and I get nothing but a blank line requiring me to ctl-c to get the prompt back.

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

ssh-keygen -t rsa -C "me@example.com" asks me for a file name and hangs

git push heroku master 挂起

$ git status 返回 在分支 master 上不需要提交,工作目录干净

$ 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 也会挂起

Updated: Using the SSH url git@github.com:gitusername/gitrepo.git also hangs

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

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

Updated: I can see the git processes running in Windows Task Manager while it hangs.

我试过了:

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

Using different internet connection locations

在 https 和 ssh 之间切换并挂起

switching between https and ssh and it hangs

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

Uninstalled git. Reinstalled from: https://code.google.com/p/msysgit/downloads/list

已卸载的 git.安装 Cygwin 的 git

Uninstalled git. Installed Cygwin's git

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

Uninstalled git. Installed Github for Windows GUI app and it I WAS able to push. But this app has limited functionality, forces me out of my Cygwin window into another app which then forces me into a Windows command prompt for complete functionality which I thought I had escaped by using Cygwin.

花了很多很多小时试图解决这个问题,之前它工作得很好,谢谢.

Spent many, many hours trying to resolve this, it worked faultlessly before, thanks.

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

UPDATE 4/2014: I rebuilt my entire machine Win 7, Cygwin etc and all is now working fine

推荐答案

尝试创建一个类似于 ~/sshv.sh 的脚本,它会向您展示 ssh 的作用:

Try creating a script like ~/sshv.sh that will show you what ssh is up to:

#!/bin/bash
ssh -vvv "$@"

允许文件所有者执行 ~/sshv.sh 文件:

Allow execution of the ~/sshv.sh file for the owner of the file:

chmod u+x ~/sshv.sh

然后调用你的 git push :

GIT_SSH=~/sshv.sh git push ...

就我而言,这帮助我弄清楚我正在使用需要关闭的 ssh 共享连接,因此我终止了那些 ssh 进程并开始工作.

In my case, this helped me figure out that I was using ssh shared connections that needed to be closed, so I killed those ssh processes and it started working.

这篇关于推送到 Github 时 Git 推送挂起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆