Issues accessing Git in the command line

Posted by Jose Estudillo on April 24, 2014

Issues accessing Git repository in the command line

Depending on the server configuration, the password to access to git repositories (between others) in the command line is requested displaying a new popup window, so you can only type the password locally in the computer or using an X11 session.

I was getting the following error trying to clone a repository from the command line:

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

This happens because the OS is trying to use a GUI to request the password, and It is impossible to use in an SSH session unless you are using X11. To deactivate this feature you just need to unset an environment variable:

    unset SSH_ASKPASS

To keep the change be sure you add this into .bashrc in your user profile or create an script in /etc/init.d to make it global.