thiagowfx's avatar

¬ just serendipity 🍀 (not just serendipity)

git: developer certificate of origin (DCO) sign-off

• 137 words • 1 min • updated

⚠️ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.

The Developer Certificate of Origin (DCO for short) is often required when sending out PRs upstream.

For example, contributions to the Linux kernel mandate it. Other projects too.

It’s even possible to enforce it via Github Actions.

Suppose that you sent a PR with a single commit but forgot to sign it off. You can amend it with:

shell
git rebase HEAD~1 --signoff
git push --force-with-lease origin [branch]

Or you can do it proactively, at commit time:

shell
git commit [-s | --signoff]

It is often discouraged to have git automatically do it:

Adding the Signed-off-by trailer to a patch should be a conscious act and means that you certify you have the rights to submit this work under the same open source license.

In practice, a sign-off is an ordinary git footer:

Signed-off-by: John Doe <john@example.com>