16

I wonder how I can add the "signed-off-by" line in a Git commit automatically within PyCharm's Commit dialog.

There are options for amending to the previous commit and changing the author of the commit, but I couldn't find an option for adding the signed-off line (git commit -s) on a per-commit basis.

Is it even possible or is it a missing feature?

Torbjörn
  • 5,512
  • 7
  • 46
  • 73

4 Answers4

15

For anyone getting this answer in google searches, here is the solution as tested in Ubuntu 16.04:

echo 'no-tty' >> ~/.gnupg/gpg.conf
echo 'use-agent' >> ~/.gnupg/gpg.conf

Then you can:

git config --global format.signoff true

This will set git to always sign-off, and set gpg to use a gtk popup to ask for your key password when needed and avoid errors in pycharm.

Hope that helps someone.

miigotu
  • 1,387
  • 15
  • 15
6

The IntelliJ plateform (Pycharm is based on it) doesn't seem to support Git sign-off yet (issue).

There's a similar request including GPG signing.

Arnaud P
  • 12,022
  • 7
  • 56
  • 67
6

In PyCharm 2016.3 (just released) it's available as a tickbox in the commit dialog.

kayess
  • 3,384
  • 9
  • 28
  • 45
2

As can be seen from the linked issues, not implemented yet but then one can simply put the signing key information inside ~/.gitconfig and run git commit -s from the command line, all else I do from within IDEA (WebStorm in my case).

Of course, I am looking forward when it's implemented and one doesn't have to hop outside IDEA just to have a commit signed and then go back and continue inside IDEA.

evdama
  • 2,166
  • 1
  • 16
  • 17