Skip to main content
GitHub Docs
  • All products
  • Building communities
    • Healthy contributions
      • Management & moderation
      • Community profiles
      • Access community profiles
      • Add a code of conduct
      • Contributor guidelines
      • Add a license to a repo
      • Add support resources
      • Community health file
      • Encourage contributions
    • Issue & PR templates
      • About templates
      • Configure
      • Syntax for issue forms
      • Syntax for GitHub's form schema
      • Create a PR template
      • Create an issue template
      • Common validation errors when creating issue forms
    • Moderation
      • Manage comments
      • Locking conversations
      • Limit interactions in repo
      • Limit interactions in account
      • Limit interactions in org
      • Track comment changes
      • Manage abuse in your org
      • Manage reported content
    • Maintaining safety
      • Block from your account
      • View blocked users in account
      • Unblock from your account
      • Block from your org
      • View blocked users in org
      • Unblock from your org
      • Reporting abuse or spam
    • Using wikis
      • About wikis
      • Manage wiki pages
      • Create footer or sidebar
      • Editing wiki content
      • View a history of changes
      • Change access permissions
      • Disabling wikis
  • Building communities/
  • Healthy contributions/
  • Add a license to a repo
 
GitHub Docs
  • Building communities/
  • Healthy contributions/
  • Add a license to a repo
Building communities
    • Get started
    • Account and profile
    • Authentication
    • Repositories
    • Enterprise administrators
    • Billing and payments
    • Site policy
    • Organizations
    • Code security
    • Pull requests
    • GitHub Issues
    • GitHub Actions
    • GitHub Copilot
    • GitHub Codespaces
    • GitHub Packages
    • Search on GitHub
    • Developers
    • REST API
    • GraphQL API
    • GitHub CLI
    • GitHub Discussions
    • GitHub Sponsors
    • Building communities
    • GitHub Pages
    • Education
    • GitHub Desktop
    • GitHub Support
    • Atom
    • Electron
    • CodeQL
    • npm
Free, Pro, & Team
    • Free, Pro, & Team
    • Enterprise Cloud
    • Enterprise Server 3.6
    • Enterprise Server 3.5
    • Enterprise Server 3.4
    • Enterprise Server 3.3
    • Enterprise Server 3.2
    • All Enterprise Server releases
    • About versions

 

Adding a license to a repository

In this article

  • Including an open source license in your repository
  • Further reading

You can include an open source license in your repository to make it easier for other people to contribute.

If you include a detectable license in your repository, people who visit your repository will see it at the top of the repository page. To read the entire license file, click the license name.

A repository header with an MIT license

Open source licenses enable others to freely use, change, and distribute the project in your repository. For more information on repository licenses, see "Licensing a repository."

Including an open source license in your repository

  1. On GitHub.com, navigate to the main page of the repository.

  2. Above the list of files, using the Add file drop-down, click Create new file. "Create new file" in the "Add file" dropdown

  3. In the file name field, type LICENSE or LICENSE.md (with all caps).

  4. To the right of the file name field, click Choose a license template. Choose a license template button

  5. On the left side of the page, under "Add a license to your project," review the available licenses, then select a license from the list. List of available licenses

  6. Click Review and submit. Review and submit button

  7. At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file. You can attribute the commit to more than one author in the commit message. For more information, see "Creating a commit with multiple co-authors." Commit message for your change

  8. Below the commit message fields, decide whether to add your commit to the current branch or to a new branch. If your current branch is the default branch, you should choose to create a new branch for your commit and then create a pull request. For more information, see "Creating a new pull request." Commit branch options

  9. If you have more than one email address associated with your account on GitHub.com, click the email address drop-down menu and select the email address to use as the Git author email address. Only verified email addresses appear in this drop-down menu. If you enabled email address privacy, then <username>@users.noreply.github.com is the default commit author email address. For more information, see "Setting your commit email address." Choose commit email addresses

  10. Click Commit new file. Commit license to branch

Further reading

  • "Setting guidelines for repository contributors"

Did this doc help you?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.

Still need help?

Ask the GitHub community
Contact support
  • © 2022 GitHub, Inc.
  • Terms
  • Privacy
  • Security
  • Status
  • Help
  • Contact GitHub
  • Pricing
  • Developer API
  • Training
  • Blog
  • About