First install git
via https://git-scm.com/download/win
Also, install Gpg4win
via https://www.gpg4win.org/
After installing Gpg4win, you can import secret key using GUI tool Kleopatra
.
Check your GPG signing key using following command
gpg --list-secret-key --keyid-format LONG
You will get following result
------------------------------------------------
sec rsa3072/XXXXXXXXXXXXXXXX 2020-08-01 [SC] [expires: 2022-08-01]
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
uid [ultimate] MyeongGeun Shin <[email protected]>
ssb rsa3072/BBBBBBBBBBBBBBBB 2020-08-01 [E] [expires: 2022-08-01]
The XXXXXXXXXXXXXXXX
part will be used for specify your secret key.
Now execute git config --global user.sigingkey XXXXXXXXXXXXXXXX
.
You must check where gpg has installed using
> where gpg
C:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe
Then, execute git config --global gpg.program "C:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe"
Now it's all done! :)
If you want to sign your commit, you must enter
git commit -S