Is there a way to “autosign” commits in Git with a GPG key?

前端 未结 5 588
悲哀的现实
悲哀的现实 2020-11-27 09:01

Is there an easy way to make Git always signs each commit or tag that is created?

I tried it with something like:

alias commit = commit -S

But th

5条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 09:24

    git config --global user.signingKey 9E08524833CB3038FDE385C54C0AFCCFED5CDE14
    git config --global commit.gpgSign true
    

    Replace 9E08524833CB3038FDE385C54C0AFCCFED5CDE14 by your key ID. Remember: It's never a good idea to use the short ID.

    UPDATE: Per a new git edict, all config keys should be in camelCase.

提交回复
热议问题