DEV Community

Cover image for Git by example - The signature you will not forget! ("missing DCO signoff")
Aurélie Vache
Aurélie Vache

Posted on

Git by example - The signature you will not forget! ("missing DCO signoff")

In the open source world, as well as in companies, you may be asked to sign your commits.
Sometimes, you know that after pushing a commit.
Don't worry, it's not too late!

DCO signoff

The story:

  • I push a commit in an (open source) repository
  • I open a Pull Request (PR)
  • I receive an automatic message:

dco signoff

"missing DCO signoff"

damn

Oh damn!! 😅
I have already commited and pushed, but the DCO is missing, what to do??

Don’t panic, there are two magical commands for this case:

$ git commit --amend --no-edit --signoff
[patch-1 174b5fb] feat: add k8saudit-ovh in registry.yaml file
 Author: Aurelie Vache <xxx@xxx.xxx>
 Date: Mon Jan 26 19:01:46 2026 +0000
 1 file changed, 27 insertions(+)

$ git push -f origin patch-1
Enter fullscreen mode Exit fullscreen mode

Let's explain the commands:

The --no-edit parameter, in the git commit command, allows to not open automatically the editor (vi on my side) with the commit and the signature. You need to close the file for the commit to occur.

And the -f parameter, in the git push command, allows you to force the push. You want to add your signature and you really want it ^^.

Tips:

You can create an alias:

alias git-oops=git commit --amend --no-edit --signoff
Enter fullscreen mode Exit fullscreen mode

You can also signoff the last two commits:

git rebase --signoff HEAD~2
Enter fullscreen mode Exit fullscreen mode

Conclusion

Git is a version manager (SCM) used in mass, but like many tools we use every day, it is full of great practical features but not very easy to understand.

I hope this example will be useful to you.

Top comments (0)