git生成Gtk-WARNING:无法打开显示 [英] git produces Gtk-WARNING: cannot open display

查看:396
本文介绍了git生成Gtk-WARNING:无法打开显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在通过命令行在我没有管理权限的机器上运行我的项目并运行 git push origin master 我得到以下错误消息:

$ p $ (gnome-ssh-askpass:29241):Gtk-WARNING **:无法打开显示:

我的 .git / config 文件具有以下内容:

blockquote

  [core] 
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remoteorigin]
fetch = + refs / heads / *:refs / remotes / origin / *
url = https://username@github.com/username/repository.git
[branchmaster]
remote = origin
merge = refs / heads / master


我之前得到了403错误。在评论此处,我把我的用户名放在远程URL的@符号之前,从那以后,我得到了Gtk错误。



当我登录到机器时 ssh -X 并尝试推送,我收到以下错误消息:

 由于错误的身份验证,X11连接被拒绝。 
(gnome-ssh-askpass:31922):Gtk-WARNING **:无法打开显示:localhost:10.0

如果我将远程的URL更改为 git@github.com:username / repository.git ,则错误为:

  ssh:连接到主机github.com端口22:连接超时
致命:远程端意外挂起

您是否知道如何解决这个问题?

解决方案

我终于找到了解决问题的办法。正如这里所描述的,我运行了以下命令终端:

  unset SSH_ASKPASS 

,然后运行 git push origin master 按其应有的方式工作。您也可以将该行添加到 .bashrc 文件中。


I've been working on my project remotely through the command line on a machine to which I don't have admin rights and after running git push origin master I get the following error message:

(gnome-ssh-askpass:29241): Gtk-WARNING **: cannot open display:

My .git/config file has the following contents:

    [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

I was getting the 403 error earlier. Following the comment here, I put my username before the @ sign in the remote url and since then, I've been getting the Gtk error.

When I login to the machine using ssh -X and try to push, I get the following error:

X11 connection rejected because of wrong authentication.
(gnome-ssh-askpass:31922): Gtk-WARNING **: cannot open display:localhost:10.0

If I change the url of the remote to git@github.com:username/repository.git, then the error is:

ssh: connect to host github.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly

Do you know how to fix this?

解决方案

I have finally discovered a solution to the problem. As it was described here, I ran the following command in the terminal:

  unset SSH_ASKPASS

and then running git push origin master works the way it should. You can also add the line to your .bashrc file.

这篇关于git生成Gtk-WARNING:无法打开显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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