Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix git commit signing #88

Open
Tracked by #6657
aleeusgr opened this issue Sep 12, 2024 · 9 comments
Open
Tracked by #6657

fix git commit signing #88

aleeusgr opened this issue Sep 12, 2024 · 9 comments

Comments

@aleeusgr
Copy link
Owner

aleeusgr commented Sep 12, 2024

I need to sign my commits:
IntersectMBO/cardano-node#5959

How to do this?

  1. install gnupg
  2. create a key
  3. tell git about the key
  4. set up commit signing
  5. git log --format=raw to see if the commits are signed.
@aleeusgr
Copy link
Owner Author

aleeusgr commented Sep 13, 2024

on nixOS these settings may be managed with home-manager

https://nix-community.github.io/home-manager/options.xhtml#opt-programs.git.signing

@aleeusgr

This comment was marked as outdated.

@aleeusgr

This comment was marked as resolved.

@aleeusgr

This comment was marked as resolved.

@aleeusgr aleeusgr reopened this Nov 18, 2024
@aleeusgr
Copy link
Owner Author

aleeusgr commented Nov 18, 2024

here I forgot to -S my commits, fix by running git rebase --signoff HEAD~2 but getting the error

image

suggested fix:

git config --global gpg.ssh.allowedSignersFile
"~/.config/git/allowed_signers"

@aleeusgr aleeusgr changed the title sign git commits enable git commit signing Nov 18, 2024
@aleeusgr
Copy link
Owner Author

Still the commits are listed as unverified:
image

I signed with ssh key:
image

But I need to sign with GPG:
image

@aleeusgr
Copy link
Owner Author

aleeusgr commented Nov 18, 2024

Maybe the key here is wrong?

nix-things/home.nix

Lines 79 to 93 in 8700390

git = {
enable = true;
userName = "Alex";
userEmail = "alexeusgr@gmail.com";
extraConfig = {
# Sign all commits using ssh key
commit.gpgsign = true;
gpg.format = "ssh";
# gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
user.signingkey = "~/.ssh/id_ed25519.pub";
};
};
gpg = {
enable = true;
};

@aleeusgr
Copy link
Owner Author

aleeusgr commented Nov 18, 2024

@aleeusgr
Copy link
Owner Author

aleeusgr commented Nov 18, 2024

Should I resign the commits or just wait for approval, then scratch this branch and open another PR?

https://stackoverflow.com/questions/62701112/is-there-a-way-to-remove-gpg-sign-of-all-previous-commits-or-resign-it-with-anot

@aleeusgr aleeusgr changed the title enable git commit signing fix git commit signing Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant