Quần Cam

Sign Git commits with Keybase

Keybase is an public key crypto for everyone, maps your identity to your public keys, and vice versa.

This post will show you how to sign your Git commit with Keybase GPG key, and how to publish your key to Github

Generate a new GPG key

In case you haven’t had any GPG keys on Keybase

$ keybase pgp gen --multi

# then follow the instruction, select "Upload your key to Keybase"

Import GPG key from Keybase

In case you already have GPG keys on Keybase

# Import secret key from keybase
$ keybase pgp export --secret | gpg --allow-secret-key-import --import

To check if your key has been imported into your local GPG secret keys

$ gpg --list-secret-keys

This is how it looks like if successfully imported.

# Private key basic information

sec   4096R/BC775C77 2016-04-09 [expires: 2032-04-05]
uid                  John Doe <[email protected]>
ssb   4096R/7BDF34CD 2016-04-09

Sign Git commit

If you want to sign your Git commit with the key generated/imported

$ git config --global user.signingkey <key-id>
# key-id is **BC775C77** for the sample private key above

Import Public key to Github

To get your commit verified by Github like below

alt text

To get your public key

$ keybase pgp export

Then attach the key to Github

alt text

That’s it! Feel free to leave your comments.


NGUY HIỂM! KHU VỰC NHIỀU GIÓ!
Khuyến cáo giữ chặt bàn phím và lướt thật nhanh khi đi qua khu vực này.
Chức năng này hỗ trợ markdown và các thứ liên quan.

Bài viết cùng chủ đề

Nhật ký hốt sh*t—Chuyện về cái service A

Bài viết mà thằng chả chém gió về cách chả monitoring và debug một sự cố gặp phải khi vận hành hệ thống Elixir

Vài ghi chép về Elixir Compiler (phần 1)

Bài viết mà thằng chả chém gió về Elixir compiler.

Lamport timestamp

Bài viết là một phần trong paper Time, Clocks, and the Ordering of Events in a Distributed System của Leslie Lamport.