Adding an open-source license to your GitHub project clarifies the terms under which others can use your work.

This can clear up potential confusion or avoid legal issues that may arise from infringement of the contract rights.

Learn how to add open-source licenses to your projects hosted on GitHub.

GitHub octocat plush toy in front of a blurred terminal

Many different open-source licenses are available, each with its own terms and conditions.

This license does not require users to credit you as the original creator.

Instead, it simply requires that users include a copy of the license with any distribution of your project.

Create new file button on GitHub

Projects such asBabel, .NET, Rails, and most npm projects use the MIT License.

Projects such asKubernetes, PDF.js, and The Swift Programming Language use the Apache license.

Projects such asAnsible, Bash, and GIMP use the GPL license.

A GitHub Create new file form with choose a license template highlighted

It is important first to determine your projects goals.

Then review the terms and conditions of each license before choosing a license for your project.

Then click theAdd filedropdown and select theCreate new fileoption, as shown in the image below.

GitHub choose a licence screen with some of the available licenses

Then, clickReview and submit, as shown in the image below.

GitHub license review and submit screen with the review and submit button highlighted

GitHub commit message screen with the commit new file button highlighted