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

南楼画角 提交于 2019-11-29 07:08:45

问题


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?


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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.



来源:https://stackoverflow.com/questions/21302034/how-to-sign-off-signed-off-by-a-git-commit-in-pycharm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!