What your licenses and GitHub's terms allow for GitHub code

We are not GitHub and don't speak for it. Not legal advice.

GitHub's terms open with "You own Your Content."1

This page is research, not legal advice.

If your company holds this kind of record, you can start without sending a file.

The same terms grant GitHub a license that includes a right to "provide, develop, and improve the Service, including by training AI Features."2 Before a buyer sees a repository, check every license file and every old commit for secrets.1, 3

Terms are agreed in writing before we approach a single buyer.

The GitHub clauses that matter before a buyer sees a repository

Clause The words we opened
Ownership GitHub's terms open with "You own Your Content."1
GitHub's license back The same terms include a license to "provide, develop, and improve the Service, including by training AI Features."2
What to check first Before a buyer sees a repository, check every license file and every old commit for secrets.1, 3

Who owns the code, and what license does GitHub take?

The same terms grant GitHub a license that includes training AI.1 Before a buyer sees a repository, check every license file and every old commit for secrets.4, 2

You own it

Section D.3 is short.1 "You own Your Content."1 If you post code you didn't write, the terms make you responsible for having the right to post it.1

What section D.4 lets GitHub do

The license to GitHub is wider than many owners expect. GitHub may copy your content to "provide, develop, and improve the Service, including by training AI Features."1 The clause adds training for the "models and technologies of our Affiliates."1 It says this "does not constitute a sale or other restricted transfer of Your Content."1 The terms we read took effect on 27 April 2026.1

Private repositories get more protection

Private code is treated as confidential.1 GitHub says it "considers the contents of private repositories to be confidential to you."1 Code you send to an AI feature as input is different.1 GitHub may use that input for training unless you opt out.1

Company contracts can change the AI terms

Section J.3's training terms "apply only to individual licenses."1 If a GitHub Customer Agreement covers your company, that agreement governs instead.1 Read your own order form before you assume either way.1

Your code versus open source in your history

License files decide what you can license

Default copyright is strict.2 GitHub's docs say "without a license, the default copyright laws apply."2 That protects your own private code.2 Open source you pulled in carries its own license, and that license travels with it.

Copyleft components

Some licenses demand that copies stay open. Vendored copyleft code can't be relicensed to a buyer on exclusive terms. List every third party license before scoping a sample.

Contributions follow the repository license

Section D.6 sets a default.1 Content added to a licensed repository is licensed "under the same terms."1 A contributor license agreement can override that.1

Issues, pull requests and review comments

Review threads are valuable and personal. They hold engineers' names, opinions and sometimes customer details pasted from tickets. Public comments are "viewed by others" under section D.5.1 Private ones still describe your staff. See employee data.

Contractors, agencies and work made for hire

Who wrote the code matters.3 Under federal copyright law, the employer is the author of a work made for hire.3 Freelancers are different unless the contract assigns the rights. Pull every contractor agreement for any repository you plan to license.

Secrets buried in commit history

Scan the whole history

Old commits keep old keys. GitHub's secret scanning "scans your entire Git history on all branches of your repository."4 For organization private repositories, it needs GitHub Secret Protection on Team or Enterprise Cloud.4

Rotate, then sample

Deleting a key from the latest commit doesn't remove it from history.4 Rotate any exposed credential before a buyer sees a single file.

GitHub texts and read dates

Opened on 19 November 2026 (PT).

  • GitHub Terms of Service, effective 27 April 2026.1
  • GitHub Docs: about secret scanning.4
  • GitHub Docs: licensing a repository.2
  • 17 U.S.C. 201(b), works made for hire.3

See also rights by system.

Start a conversation before you clone anything for a buyer.

Sources

  1. GitHub Terms of Service. Accessed 19 Nov 2026.
  2. GitHub Docs, "Licensing a repository". Accessed 19 Nov 2026.
  3. 17 U.S.C. 201(b) (LII). Accessed 19 Nov 2026.
  4. GitHub Docs, "About secret scanning". Accessed 19 Nov 2026.

If these github notes touch records you hold

Talk with your counsel about the rule itself. A few questions start the conversation, and no file is asked for.

If your company holds this kind of record, you can start without sending a file.