将 Git 凭据帮助程序与 gnome-keyring 一起用作 Sudo 时出错 [英] Error when using Git credential helper with gnome-keyring as Sudo

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

问题描述

我一直在寻找一种在连接到使用 SSL 的 Git 服务器时安全存储凭据的方法.我遇到了@james-ward 的这个建议(我所做的唯一编辑是我更新了我们的系统"配置而不是 Git 的全局"配置(https://stackoverflow.com/a/14528360/6195194)

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

然后我可以运行

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

它给了我以下错误

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

我有时需要运行 sudo git clone 因为有时我需要进行克隆的目录需要它.任何帮助将不胜感激.

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.

我使用的版本:- git 版本 1.9.1- Ubuntu 服务器 14.0.4

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

先谢谢你!-Richard O.

Thank you in advance! -Richard O.

推荐答案

我有时需要运行 sudo git clone 因为有时我需要进行克隆的目录需要它.任何帮助将不胜感激

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

您尝试将存储库克隆到的文件夹是由 root 创建的,因此除非您是 root (sudo),否则您无权在其下写入或创建文件夹,请设置权限 (chmodchown),您将能够克隆到该文件夹​​中.

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天全站免登陆