I am just wondering how can VC can be used to sign commit using gpg, Currently I am using vc without sign mean I am using vc-next-action to perform git commit

1 Answer 1


vc doesn't know anything about signing commits. magit does, though. If you're willing to have all your commits signed you can set commit.gpgSign in your git configuration file.

  • I'll use commit.gpgSign in git local configuration then. That solves my problem. Thanks!
    – nerding_it
    Sep 29, 2020 at 15:58
  • Does it ask for passphrase? Mine is failing because there is not tty to ask for passphrase. Oct 4, 2020 at 17:15
  • 1
    @Jangid, you should look through the existing questions on how to use gpg with emacs, I'm certain this has been answered before.
    – rpluim
    Oct 5, 2020 at 14:12
  • @rpluim, my gpg is working fine with emacs. I can encrypt files with .gpg extension, I can sign and encrypt emails. But only vc things are not working with gpg. As a workaround what I do is this. I run a pull request on cli, enter passphrase and because the ttl is set to about 10 mins, vc-next-action works without going into passphrase phase. Oct 6, 2020 at 3:59
  • 1
    @rpluim, normally, when I encrypt/sign emails or open .gpg files I get a prompt in mini-buffer at the bottom. Because of (setq epg-pinentry-mode 'loopback). But for vc, as you said, I get a prompt outside emacs. And on MacOS that is somewhat mangled so I cannot enter passphrase. Not Sure why I am not getting the prompt in the minibuffer like in the case of normal file encryption etc. Oct 29, 2020 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.