In my GitHub Repository i have a branch , with some commits that are unverified, is there any way to change them to verified ?
2 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 or any other long-lasting branches you may work together with other people
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.
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.
-
3as you can see in my image, my new commits become "verified" after fixing my email address, how i can change my old commits from "unverified" to "verified" ?– YosefarrCommented Dec 16, 2019 at 6:18
-
-
Some times it is because of date/time problems Fix it by executing this these shell commands.... Replace with the last commit from where it is showing unverified. I think starting of your last commit hash is df7326e (shown in the picture)
$ cd path/to/your/git
$ git filter-branch -f --commit-filter 'git commit-tree -S "$@";' -- --all
$ git rebase --committer-date-is-author-date <HASH>