If you're using a GPG key that matches your committer identity and your verified email address associated with your account on your GitHub Enterprise Server instance, then you can begin signing commits and signing tags.
-
[ターミナル][ターミナル][Git Bash] を開きます。
-
公開キーと秘密キーの両方がある GPG キーを長い形式で一覧表示するには、
gpg --list-secret-keys --keyid-format=longコマンドを使用します。 コミットやタグに署名するには秘密鍵が必要です。Shell $ gpg --list-secret-keys --keyid-format=long注: Linux での一部の GPG インストールには、代わりに既存のキーの一覧を表示するには、
gpg2 --list-keys --keyid-format LONGの使用が必要となる� �合があります。 この� �合、git config --global gpg.program gpg2を実行してgpg2を使用するには、Git を構成する必要もあります。 -
GPGキーのリストから、使いたいGPGキーIDの長い形式をコピーしてく� さい。 この例では、GPG キー ID は
3AA5C34371567BD2です。Shell $ gpg --list-secret-keys --keyid-format=long /Users/hubot/.gnupg/secring.gpg ------------------------------------ sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10] uid Hubot <hubot@example.com> ssb 4096R/42B317FD4BA89E7A 2016-03-10 -
Enter
gpg --edit-key GPG key ID, substituting in the GPG key ID you'd like to use. In the following example, the GPG key ID is3AA5C34371567BD2:$ gpg --edit-key 3AA5C34371567BD2 -
Enter
gpg> adduidto add the user ID details.$ gpg> adduid -
Follow the prompts to supply your real name, email address, and any comments. You can modify your entries by choosing
N,C, orE.Real Name: OCTOCAT Email address: "octocat@github.com" Comment: GITHUB-KEY Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? -
Enter
Oto confirm your selections. -
Enter your key's passphrase.
-
Enter
gpg> saveto save the changes$ gpg> save -
Enter
gpg --armor --export GPG key ID, substituting in the GPG key ID you'd like to use. In the following example, the GPG key ID is3AA5C34371567BD2:$ gpg --armor --export 3AA5C34371567BD2 # Prints the GPG key, in ASCII armor format -
Upload the GPG key by adding it to your GitHub account.