Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using the git client on a headless linux server

Tags:

git

linux

How do I force the git-client to use the console/terminal only. When I ssh into my remote/headless linux computer and try to run:

git clone https://[email protected]/xxx/xxx.git

git complains and gives me this error: (gnome-ssh-askpass:2769): Gtk-WARNING **: cannot open display:

I dont want to use a graphical interface nor ssh -X. I just want to configure the git-client to use the terminal only.

Im using CentOs and got the git-client with yum install git.

like image 386
ehrhardt Avatar asked May 02 '13 22:05

ehrhardt


1 Answers

You can disable gnome-ssh-askpass in the current session by unsetting the SSH_ASKPASS environment variable:

unset SSH_ASKPASS

You could probably add it in your .bashrc or .profile with a conditional check whether the user logged in using SSH. Something like:

[ -n "$SSH_CONNECTION" ] && unset SSH_ASKPASS

BTW, someone else has also complained about the git's behavior of invoking the SSH_ASKPASS program blindly without determining if it is a GUI session or not. If you read the full thread, it would explain it is not possible to use DISPLAY environment variable to detect this. Also there is no mention of whether that patch was accepted or not.

like image 198
Tuxdude Avatar answered Sep 17 '22 14:09

Tuxdude