CLA or DCO? Two Ways a Package Can Accept Outside Code
Once strangers start sending pull requests, a maintainer eventually wonders what legal footing those contributions stand on. Two broad answers dominate open source: a contributor licence agreement (CLA) or the Developer Certificate of Origin (DCO). They solve overlapping problems with very different amounts of friction. This page lays out both fairly; it is general background, not legal advice.
What each one is
A CLA is a document a contributor signs, usually once, before their first contribution is merged. It typically grants the project or a sponsoring organisation a broad licence to the contribution, sometimes including the right to relicense it, and may include a patent grant. The Apache Software Foundation's individual CLA is a well-known example, and many companies that sponsor open source projects use their own versions.
The DCO is a short statement, maintained by the Linux Foundation and used by the Linux kernel, in which a contributor certifies that they have the right to submit the code under the project's licence. Contributors agree to it per commit by adding a sign-off line, which Git produces with the -s flag:
git commit -s -m "Fix off-by-one in range parser"
# produces a trailer like:
Signed-off-by: Contributor B <contributor-b@example.org>
Under a DCO the contribution is licensed under the project's existing licence, inbound equals outbound, with no separate grant to anyone.
Side by side
| CLA | DCO | |
|---|---|---|
| Contributor effort | Read and sign a document, sometimes employer approval | Add a sign-off to each commit |
| Rights granted | Whatever the agreement says, often broad | Only the project's licence |
| Relicensing later | Often possible for the holder | Requires consent from contributors |
| Tooling | A bot that checks a signature record | A check that every commit has a sign-off |
| Common objection | Feels one-sided; deters drive-by fixes | Forgotten sign-offs block merges |
The arguments people actually make
Supporters of CLAs value certainty. A company that may need to dual-license, defend the project in court or move it to a foundation wants clear paperwork. Critics reply that a CLA asymmetrically lets one party relicense everyone's work, possibly to a proprietary licence, and that the signing step discourages exactly the small contributions that keep libraries healthy.
DCO supporters like that it is lightweight and symmetrical: everyone, including the sponsor, is bound by the same licence. Critics note that it provides less explicit patent coverage than some CLAs, although licences such as Apache-2.0 already include a patent grant of their own.
Picking for a small package
- Solo or community-run library under a permissive licence: many choose neither, relying on the licence itself, or adopt the DCO for a clear record.
- Company-sponsored library with plans to offer a commercial edition: a CLA is common, and the trade-off is fewer casual contributors.
- Joining a foundation: follow its rules, which may require one or the other.
Whatever you choose, state it in CONTRIBUTING.md before the first pull request arrives. If licence choice itself is still open, start with our permissive vs copyleft overview, and for complex situations consult a lawyer familiar with open source.