-1

I was about to merge a PR to master but got blocked by error message

The base branch requires all commits to be signed.

Does this mean there are unsigned commits on mater branch? How do I resolve this error?

neo
  • 9
  • 1
  • 3
  • 3
    This probably means their are unsigned commits in your PR, not the master branch – Mureinik Dec 16 '21 at 16:11
  • 1
    This might help? https://stackoverflow.com/questions/36512852/how-do-i-cryptographically-sign-all-commits-on-a-branch – evolutionxbox Dec 16 '21 at 16:12
  • Did you in fact sign your commits? – matt Dec 16 '21 at 17:35
  • You can only sign a commit at the time you make it. You cannot change a commit once it is made, so it's impossible to sign an unsigned commit—but you can *copy* a commit (which is what `git cherry-pick` does, for one commit, and what `git rebase` does for an entire series of commits) and sign them during the copying process. – torek Dec 16 '21 at 20:33

1 Answers1

0

It depends on your situation. If the branch hasn't been shared with others, you might be able to use rebase to solve the problem. A rebase will allow you to amend the commit messages as you wish, including adding a signature. The down-side of this is that the commits all get a new id, so if other people have done further work based on them, it will get messy and create extra work. If the branch hasn't been merged into other branches, and you'd be able to delete the branch from the server without problems, you should be OK.

Check the documentation here https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History It's pretty clear, although you will want to read it all before beginning.

Dominic Cronin
  • 6,062
  • 2
  • 23
  • 56