Quần Cam Blog

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.

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ủ đề

Tôi đã tiết kiệm $5 mỗi tháng với Heroku như thế nào?

Vừa rồi mình vừa tiết kiệm được $5 mỗi tháng sau khi migrate cái blog cá nhân từ Digital Ocean sang Heroku Free Dyno. Bài viết này chia sẻ lại quá trình đó.

Bundler Gotcha

A few days ago I encountered a strange behavior of Bundler so this post notes down how my experience with it was.

UX for CLI app

As a terminal lover, I always want to get everything done on my terminal, instead of switching to browser or an external app. I personally built up a couple of CLI apps for my personal use (checkout worque and 3llo).