使用Git凭证助手和gnome-keyring作为Sudo时出错 [英] Error when using Git credential helper with gnome-keyring as Sudo

查看:509
本文介绍了使用Git凭证助手和gnome-keyring作为Sudo时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种安全存储凭证的方式,同时连接到使用SSL的Git服务器。我碰到@ james-ward的这个建议(我编辑的是我更新了我们的系统配置,而不是我们的Git的全局配置( https://stackoverflow.com/a/14528360/6195194

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

然后我可以

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

,并且凭证帮助程序将存储我的凭据,但是当我运行以下命令时:

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

它给我以下错误:

pre $ **(process:3713):CRITICAL **:与gnome-keyring- daemo n

我有时需要运行sudo git clone,因为有时我需要创建一个克隆的目录需要它。任何帮助将不胜感激。



我使用的版本:
- git版本1.9.1
- Ubuntu Server 14.0.4



预先感谢您!
-Richard O

解决方案

有时我需要运行sudo git clone,因为有时我需要做一个克隆的目录需要它。任何帮助将不胜感激


您尝试克隆存储库的文件夹是由root创建的,因此您无权写入或者在它下面创建文件夹,除非你是root用户( sudo ),请设置权限( chmod chown ),你就可以克隆到文件夹中。

  chmod 755 / path 


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 (https://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.

解决方案

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

这篇关于使用Git凭证助手和gnome-keyring作为Sudo时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆