Richard Oswald Richard Oswald - 1 month ago 16
Git Question

Error when using Git credential helper with gnome-keyring as Sudo

I was looking for a way to store credentials securely while connecting to our Git server which uses SSL. I came across this suggestion by @james-ward (only edit I made was I updated our "system" config instead of our "global" config for Git (http://stackoverflow.com/a/14528360/6195194)

sudo apt-get install libgnome-keyring-dev
cd /usr/share/doc/git/contrib/credential/gnome-keyring
sudo make
git config --system credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring


I then can run

git clone https://ipaddress/git/repo.git


and the credential helper will store my credentials, however when I run the following:

sudo git clone https://ipaddress/git/repo.git testfolder


it give me the following error

** (process:3713): CRITICAL **: Error communicating with gnome-keyring-daemon


I sometimes need to run sudo git clone since sometimes the directory where I need to make a clone requires it. Any help would be appreciated.

Versions I am using:
- git version 1.9.1
- Ubuntu Server 14.0.4

Thank you in advance!
-Richard O.

Answer

I sometimes need to run sudo git clone since sometimes the directory where I need to make a clone requires it. Any help would be appreciated

The folder in which you try to clone the repository into was created by root so you dont have permission to write or to create folder under it unless you are root (sudo), set the permissions (chmod or chown) and you will be able to clone into the folder.

chmod 755 /path