Picking a licence is half the work. Actually attaching it so it is discoverable, enforceable, and scannable by compliance tooling is the other half.
For a software repository
Add a
LICENSEfile at the root of the repository containing the full text of the chosen licence. Use the canonical text from the licence’s official source, not a paraphrase.Fill in the copyright line if the licence template has one (MIT, BSD, Apache all do). Use the current year and the correct author or organisation name.
Add SPDX headers to every source file:
// SPDX-License-Identifier: MITUpdate
package.json/pyproject.toml/ equivalent to declare the licence using its SPDX identifier.If the licence has a
NOTICErequirement (Apache-2.0 does, indirectly), include aNOTICEfile listing attributions.Commit the change with a clear message. A fresh repo’s first commit should include the licence.
For content (text, images, video)
Publish the work with a visible attribution + licence line near the work, for example:
"Work Title" by Author Name is licensed under CC BY 4.0. https://creativecommons.org/licenses/by/4.0/For images, include EXIF or IPTC metadata where possible.
For websites, add a
<link rel="license">in the page head and/or footer links.
For datasets
- Include a
LICENSEfile in the dataset archive. - Include a
READMEthat names the licence and provides citation instructions. - If the data has sui generis database rights (EU), pick a licence that addresses those rights (ODbL, CC-BY-4.0, CC-BY-SA-4.0).
- Record the licence in the dataset’s catalogue metadata (DataCite, schema.org/Dataset).
For proprietary or confidential work
- Put a copyright notice at the top of each file.
- For distributed software, write an EULA and require acceptance before installation or first use.
- Record the accepted version of the EULA per user, with timestamp.
- If the work is confidential, pair the licence with an NDA.
Making the licence discoverable
- GitHub and GitLab surface the licence automatically when the
LICENSEfile matches a recognised template. - Crates.io, npm, PyPI all read the licence from the manifest.
- Package managers sometimes gate installations on the licence — make sure yours is a well-known SPDX identifier if you publish to a registry.