• Register
0 votes
519 views

Problem :

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

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

My .git/config file has the below 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

Initially I was getting the 403 error. When I put the username before the @ sign in the remote url shown in above file and since then, I am facing the Gtk error.

Whenever I try to login to the machine using ssh -X and try to push, I often face the below error:

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

If I try to change the url of the remote box to git@github.com:username/repository.git, then I face different error and it is as below :

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

Does anyone have any solution for my issues?

6 5 3
7,540 points

1 Answer

0 votes

Solution :

I have finally discovered the solution to your problem. I ran the below command in the terminal:

unset SSH_ASKPASS

and after that ran the git push origin master and it works the way it should. You should also add the above given line to your .bashrc file.

9 7 4
38,600 points

Related questions

0 votes
1 answer 1.5K views
1.5K views
Problem : I have the below problem when I just try to pull code, using my GIT Bash on windows Even after adding/removing the origin I am still facing the same error as below. Fatal: could not read Username for 'https://github.com': No such file or directory
asked Dec 19, 2019 alecxe 7.5k points
0 votes
1 answer 45 views
45 views
Problem : I am currently using the SourceTree and trying to clone it from the general github repository, but I am facing below error: “Fatal: unable to access 'https://github.com/mfitzp/15-minute-apps.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version Completed with errors, see above.” How can I resolve it?
asked Jan 3 alecxe 7.5k points
0 votes
1 answer 683 views
683 views
Problem : This is the very first time that I am using Jenkins and I have gone through the several articles but unable to find any satisfactory answers. We have the .Net project, and we are using our private GitHub repository. ... hooks on GitHubRepositoryName[host=github.com,username=MyCompanyName,repository=reponame] at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:342)
asked Dec 27, 2019 alecxe 7.5k points
0 votes
1 answer 1.7K views
1.7K views
Problem : I am trying to run startx via PuTTY and Xming but it gives following error: putty x11 proxy: unable to connect to forwarded x server: network error: connection refused
asked Nov 18, 2019 peterlaw 6.9k points