143

Git 1.8.0は、gnome-keyringとの統合をサポートしています。

http://www.h-online.com/open/news/item/Git-1-8-0-can-access-Windows-and-GNOME-keyrings-1733879.html

gitクレデンシャルヘルパーに関するドキュメントを読んだ後:http://git-scm.com/docs/gitcredentials.html

この新機能を使用する方法を見つけることができませんでした。どうすれば統合できますか?ArchlinuxのリポジトリからgitがインストールされたArchlinuxを使用しています。(git 1.8.0)

4

9 に答える 9

221

@marcosdsanchezの答えはArch(元の質問に答えます)に対するものですが、私はUbuntuを使用しています。git >= 2.11 の場合:

sudo apt-get install libsecret-1-0 libsecret-1-dev
cd /usr/share/doc/git/contrib/credential/libsecret
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

git < 2.11 の場合:

sudo apt-get install libgnome-keyring-dev
cd /usr/share/doc/git/contrib/credential/gnome-keyring
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring
于 2013-01-25T18:45:33.653 に答える
59

Git 1.8.0 には gnome-keyring のサポートが付属していますが、バイナリをプラットフォーム用にコンパイルする必要があります。

これがArchlinuxで解決したものです:

$ sudo pacman -S libgnome-keyring
$ cd /usr/share/git/credential/gnome-keyring
$ make
$ git config --global credential.helper /usr/share/git/credential/gnome-keyring/git-credential-gnome-keyring

@VonC ソリューションは近いものでしたが、git config コマンドは実行可能ファイルを指す必要があります。それが私にとってはうまくいかなかった理由です。

于 2012-11-15T02:51:49.603 に答える
26

2016 年第 4 四半期の更新:

  • Unix、Mac (Git 2.11+)

    git config --global credential.helper libsecret
    

(「Git クレデンシャル ヘルパーを使用するとエラーが発生するgnome-keyring」を参照)

  • ウィンドウズ:

    git config --global credential.helper manager
    

(「Windows の Git Bash コンソールでサインアウトする方法」を参照してください:最新のMicrosoft Git Credential Manager for Windows を使用したGit for Windows です)


元の回答 (2012)

Windows、Mac、および Unix プラットフォーム用の資格情報ヘルパーは、「git-credential-helper」リポジトリで最初に導入され、現在は git distro に含まれています

このリポジトリには、Git 認証情報ヘルパーのセット ( gitcredentials(7)) が含まれており、これらは一部であるgit(または将来的に提供される予定です)。

$ git clone git://github.com/pah/git-credential-helper.git
$ BACKEND=gnome-keyring      # or any other backend
$ cd git-credential-helper/$BACKEND
$ make
$ cp git-credential-$BACKEND /path/to/git/crendential

ビルドすると、/path/to/git/credentialディレクトリにインストールされます。

このバックエンドを使用するには、設定して (グローバル) Git 構成に追加できます。

(Unix の場合はこちら):

git config --global credential.helper /path/to/git/credential/gnome-keyring/git-credential-gnome-keyring

Windows の場合:

Windows 上で実行され、「 pypi keyring 0.10」のようなライブラリを呼び出すプログラムを作成できると思いますが、それ
はバックエンドであり、Git から直接使用することはありません。

使用しているのは「資格情報ヘルパー」です (これは、Windows で必要な資格情報 API を呼び出します)。

GitHub for Windowsは、そのようなヘルパー (... github と呼ばれる実行可能ファイル) を提供し、Windows セッションの間、資格情報を保存できます。
その「GitHub for Windows」ウィンドウからシェルを起動すると、「git config --system -l」と入力して表示されます。

C:\Users\VonC\Documents\GitHub\test [master +2 ~0 -0 !]> git config --system -l
credential.helper=!github --credentials

パーツはcredential.helper=!github --credentials資格情報ヘルパー ' github' を呼び出します。

$ git config [--global] credential.helper $BACKEND
于 2012-11-14T20:02:58.800 に答える
11

Fedoraの誰でも、James Wardの答えを少し編集しました:

sudo yum install libgnome-keyring-devel
cd /usr/share/doc/git/contrib/credential/gnome-keyring
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring
于 2014-01-17T17:28:44.887 に答える