Torbjörn
Torbjörn

Reputation: 5800

How to sign-off ("signed-off-by") a Git commit in PyCharm?

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?

Upvotes: 16

Views: 5179

Answers (4)

Sjoerd van Poelgeest
Sjoerd van Poelgeest

Reputation: 143

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

Upvotes: 6

miigotu
miigotu

Reputation: 1685

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.

Upvotes: 15

evdama
evdama

Reputation: 2206

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.

Upvotes: 2

Arnaud P
Arnaud P

Reputation: 12607

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.

Upvotes: 6

Related Questions