【发布时间】:2013-04-11 06:34:20
【问题描述】:
我一直在通过我没有管理员权限的机器上的命令行远程处理我的项目,在运行 git push origin master 后,我收到以下错误消息:
(gnome-ssh-askpass:29241): Gtk-WARNING **: cannot open display:
我的.git/config 文件有以下内容:
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = https://username@github.com/username/repository.git [branch "master"] remote = origin merge = refs/heads/master
我之前收到了 403 错误。在评论 here 之后,我将用户名放在远程 URL 中的 @ 符号之前,从那时起,我一直收到 Gtk 错误。
当我使用ssh -X登录机器并尝试推送时,出现以下错误:
X11 connection rejected because of wrong authentication.
(gnome-ssh-askpass:31922): Gtk-WARNING **: cannot open display:localhost:10.0
如果我把遥控器的url改成git@github.com:username/repository.git,那么报错是:
ssh: connect to host github.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly
你知道如何解决这个问题吗?
【问题讨论】:
-
我猜你正在使用 ssh。请改用 ssh -X。这意味着密码对话框正在尝试打开,但因为没有 X 而无法打开。
-
谢谢,但我没有明确使用ssh,只是调用
git push origin master,所以我不知道如何应用你所说的? -
我可以知道您从哪里推送到服务器吗?我的意思是从哪台机器?你是怎么登录那台机器的?
-
糟糕。对不起。我没有完全阅读你的问题。您的“网址”应该是
git@github.com:username/repo.git或https://github.com/username/repo.git但您同时使用两者。 -
哦,对不起,我现在明白你的意思了。我尝试使用
ssh -X登录机器,但这也无济于事。请参阅上面的更新问题。
标签: git version-control github ssh