How to Add Licensing to Your Open Source Project on GitHub?

Open-source projects are a great way to share your code and collaborate with others. However, without proper licensing, your project may face legal issues and misuse. Adding a license to your GitHub project is important for protecting your work and clarifying how others can use it. In this article, we will see how to add licensing to your open-source project on GitHub.

Why You Need a License

A license specifies what others can and cannot do with your code. It helps you:

  • Protect your rights: Ensure that you get credit for your work.
  • Set usage terms: Define how others can use, modify, and distribute your code.
  • Limit liability: Reduce your legal risk if something goes wrong with your code.

Github Opensource Licensing

As a developer, you should know about Git and GitHub, while creating a repository on GitHub it asks for a license generally we don’t care about it because we create a common project repository, not an open-source project. Open source always consists of a particular license. Now there are two or more ways in which we can add the license to opensource a project on GitHub and we will discuss both of them in the following section. 

How to Add Licensing to OpenSource Project

On GitHub, while creating a repository it will ask for particular licensing and before selecting a license for the project it’s highly recommended to read the documentation of the license.

Add Licensing to Your Open Source Project on GitHub

Method 1: Before creating a project

  • Step 1: Mentioned the name of the repo.
  • Step 2: Write a description of the project.
  • Step 3: Choose public for open source projects.
  • Step 4: Add readme to it, if you already have then ignore this step.
  • Step 5: Initialize the gitignore file.
  • Step 6: Select appropriate licensing for your open source project.
  • Step 7: Click on create a repository and finish. 

Method 2: After creating a project

Somehow you create a project and forget to select Licencing to it then how you can add the license to it? so, there are other ways in which you can add licensing to the project and you have to follow the below steps to do it. 

Step 1: Navigate to your GitHub repository and select add file and create a new file.

Add Licensing to Your Open Source Project on GitHub

Step 2: After selecting a new file give a name to it as License.md 

Add Licensing to Your Open Source Project on GitHub

Step 3: Now on the right-hand side select choose license template.

Add Licensing to Your Open Source Project on GitHub

Step 4: Now select the appropriate license for your project.

Add Licensing to Your Open Source Project on GitHub

Step 5: After selecting the license click the review and submit button. 

Add Licensing to Your Open Source Project on GitHub

Step 6: It will review and your license file looks like this. 

Add Licensing to Your Open Source Project on GitHub

Step 7: Now commit the file and add it to the project.

Add Licensing to Your Open Source Project on GitHub

Step 8: License successfully added to your project.

Add Licensing to Your Open Source Project on GitHub

Step 9: Now your license file is successfully added to your open source project.

Here we have done with open-source project licensing and ways to add licensing to the open-source project with step by step. 


Contact Us