Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unverified commits in GitHub

Tags:

git

github

In my GitHub Repository i have a branch , with some commits that are unverified, is there any way to change them to verified ?

enter image description here

like image 437
Yosefarr Avatar asked Dec 16 '19 06:12

Yosefarr


People also ask

Why are some commits not verified?

Any of the following is true: - The commit is signed but the signature could not be verified. - The commit is not signed and the committer has enabled vigilant mode. - The commit is not signed and an author has enabled vigilant mode.

What does verified mean in GitHub?

When you submit your public key in GitHub, GitHub can verify that the signed commit was created by your account. All it means is that anyone with access to the repository can see that the commit was made on your system by somehow who knows the passphrase to unlock your public key. Ideally, this can only be you.

How do I verify a tag in GitHub?

Verify your signed tag by running git tag -v [tag-name] .


Video Answer


1 Answers

Unverified means your signature is wrong.

This can be if you commit with the wrong E-Mail/Password, if you haven't uploaded the Signature on GitHub(on that account) or if you've uploaded it wrongly.

I think this is because you use the signature of your main account for committing with the other (maybe non-existing) account (maybe because you activated commit.autosign).

Your signature has to contain the E-Mail address of the account(that committed) and that account has to have the signature (with the E-Mail) uploaded on GitHub.

A commit from a non-existing user cannot be verified on GitHub too.

If you want to verify existing commits, you have to overwrite them.

This involves a force push that forces other people to re-clone the repo. Because of that, you should not force push to master.

You can do this by re-committing it:

git rebase -i <commit before first problematic commit>

After this, your text editor will open up. Change every pick to edit.

After that you'll have to re-commit every commit with the following command:

git commit --author="<name> <<E-Mail(once in brackets, see example)>>" -S --amend --no-edit
git rebase --continue

In the end, you'll have to overwrite the remote by doing

git push --force-with-lease

This is better than git push -f but you should also be careful.

If someone knows a way to do this automatically, tell me in the comments.

example of the commit command:

git commit --author="testuser <[email protected]>" -S --amend --no-edit

You also could do this using the git filter-branch command.

See this for details.

like image 77
dan1st Avatar answered Nov 15 '22 01:11

dan1st