Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git produces Gtk-WARNING: cannot open display

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.


I recently dealt with this behavior on a RedHat 5 machine where our Git version was 1.7.4.1.

I didn't have a high degree of confidence that unset SSH_ASKPASS wouldn't have unintended consequences, so I wanted to see if there was another solution.

I couldn't tell for certain, but it seems that a patch for this problem was in the works around the same time that our version of Git had been published. So, it seemed to me that it was reasonable to hope that a more recent version would correct the behavior.

And indeed it did. Upgrading to the 1.8 branch of Git resolved the problem. The error message is still displayed for some odd reason, but you are correctly prompted for your password and allowed to continue.