Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 使用Cygwin将Git推送到远程服务器挂起_Windows_Git_Ssh_Cygwin - Fatal编程技术网

Windows 使用Cygwin将Git推送到远程服务器挂起

Windows 使用Cygwin将Git推送到远程服务器挂起,windows,git,ssh,cygwin,Windows,Git,Ssh,Cygwin,我是通过命令行接触git的新手,遇到了一些无法摆脱的麻烦 我已经在我的服务器上设置了一个存储库,并使用上的说明创建了一个本地目录 在服务器上: ssh git@example.com mkdir my_project.git cd my_project.git git init --bare git update-server-info # If planning to serve via HTTP exit 然后,在本地计算机上: cd my_project git init git add

我是通过命令行接触git的新手,遇到了一些无法摆脱的麻烦

我已经在我的服务器上设置了一个存储库,并使用上的说明创建了一个本地目录

在服务器上:

ssh git@example.com
mkdir my_project.git
cd my_project.git
git init --bare
git update-server-info # If planning to serve via HTTP
exit
然后,在本地计算机上:

cd my_project
git init
git add *
git commit -m "My initial commit message"
git remote add origin git@example.com:my_project.git
git push -u origin master
当我到达这里的最后一个命令“gitpush-uoriginmaster”时,该命令会一直挂起,并且永远不会停止挂起

本地的git状态为我提供了以下信息:

$ git status
On branch master
nothing to commit, working directory clean
服务器上的git状态(在myproject.git/内)为我提供:

我不确定下一步该去哪里,我尝试了很多东西,但我的无知是多山的,我需要一个向导;也许是一个巫师,一些矮人,还有哈比人,如果你有备用的话。任何帮助都将不胜感激

我使用的是Windows8.1。 使用Cygwin


谢谢。

问题是您在.git文件夹中。 您需要在根文件夹(即.git的父文件夹)中才能查看状态,然后推送所有更改

cd..
git status
如果您使用的是Windows,则是更好的选择。在Cygwin中使用
git push
已知存在问题。要点是Git在默认情况下会尝试使用“简单密码提示”作为其用户身份验证过程的一部分,如
Git config
(搜索
core.askpass
)中所述。但是,此密码提示仅适用于真正的UNIX,而不适用于Cygwin。如果感兴趣,您可以阅读有关此问题的历史

如果您必须使用Cygwin,那么请确保按照指定安装了Cygwin git包。然后尝试运行以下命令:

$git config--global core.askpass/usr/libexec/git core/git gui--askpass


可能还有其他更复杂的解决方案,但我认为最简单的解决方案仍然是安装msysgit.:-)

似乎使用GitBash(我假设它是msysgit)解决了这个问题。我不需要更改我所在的目录,git push运行得很好。魔术谢谢大家!干杯你好!很抱歉。我本来会早点接受的,但我心里充满了烦恼,不知道该怎么做。
cd..
git status