Skip to content

Latest commit

 

History

History
57 lines (46 loc) · 3.24 KB

adding-a-license-to-a-repository.md

File metadata and controls

57 lines (46 loc) · 3.24 KB
title intro redirect_from versions topics shortTitle
Adding a license to a repository
You can include an open source license in your repository to make it easier for other people to contribute.
/articles/adding-a-license-to-a-repository
/github/building-a-strong-community/adding-a-license-to-a-repository
fpt ghes ghec
*
*
*
Community
Add a license to a repo

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.

Screenshot of the main page of the github-linguist/linguist repository. In the right sidebar, "MIT license," preceded by a law icon, is outlined in dark orange.

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

Including an open source license in your repository

{% ifversion fpt or ghec %} {% data reusables.repositories.navigate-to-repo %} {% data reusables.files.add-file %}

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

  2. Under the file name, click Choose a license template.

    Screenshot of the new file form, with "LICENSE" entered in the file name field. A button, labeled "Choose a license template," is outlined in dark orange.

  3. 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.

  4. Click Review and submit. {% data reusables.files.write_commit_message %} {% data reusables.files.choose_commit_branch %} {% data reusables.files.choose-commit-email %} {% data reusables.files.propose_file_change %}

{% endif %}

{% ifversion ghes %}

{% data reusables.repositories.navigate-to-repo %} {% data reusables.files.add-file %}

  1. In the file name field, type LICENSE or LICENSE.md (with all caps).
  2. On the Edit new file tab, paste the full text of the license you want to use. {% data reusables.files.write_commit_message %} {% data reusables.files.choose-commit-email %}
  3. 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 main, you should choose to create a new branch for your commit and then create a pull request. For more information, see "AUTOTITLE". Screenshot of a {% data variables.product.prodname_dotcom %} pull request showing a radio button to commit directly to the main branch or to create a new branch. New branch is selected. {% data reusables.files.propose_file_change %}

{% endif %}

Further reading