Git sign off previous commits?

后端 未结 8 533
没有蜡笔的小新
没有蜡笔的小新 2020-12-12 11:24

I was wondering how to sign(-s) off previous commits that I have made in the past in git?

8条回答
  •  [愿得一人]
    2020-12-12 11:49

    For me just ammending signof, didn't actually verify my commits on github.

    The solution that is worked for me is going back, and then sign each commit with -S

    git commit --amend -S
    

    Also if you check if your commit is actually signed, and your email/name is simply not appended, use this command

    git show HEAD --show-signature
    

    Extra tip: If you are already amending your commits, you may want your real name in them (see using git log). You may be using your github handle name, which is not needed. Only correct email is needed and in field of username you should use your full name and github will track it correctly with your github handle name. So to correct your user name and sign last commit use:

    git commit --amend --author="FULL NAME " -S
    

    and also set full name for user name in future by

    git config --global user.name "FULL NAME"
    

提交回复
热议问题