DEV Community

RIshi Dutt Shukla
RIshi Dutt Shukla

Posted on • Updated on

Importance of Licensing your code & choosing a license on GitHub

Hey there, I hope you're doing well! 😊

I see a lot of people passionate about open source and impressed by the idea that you can create software with anyone in the world. But I see them doing one thing wrong every time. Which is - not licensing their code, and then expecting contribution.

So in this post I'll tell you just that. I will tell you about licensing your code and why you should license your code. In a closed source project, you do licensing. But in an open-source project, it is important to license your code as well.

What is a license anyway?

A license is a way of telling others what they can do and what they can't do with your code.

What does it mean when your code is not licensed

When you do not license your code on a code host like GitHub then it means that no one has permission to use and/or modify your code. You want it to be open and attract contribution when you're posting your code on GitHub, no? So adding a license is a must.

How do I get started with licensing?

You can directly head to Choose a License for an awesome intro to licensing your code. They will guide you in choosing your license, according to your use case.

What are the many types of licensing available

There are many kinds of licensing available

  • MIT license
  • Apache License
  • GNU GPL v3 and so on.

How do you choose a license on GitHub?

GitHub has made it more easier for us to add a license.

  1. Head to the repository in which you want to add a license. And then click on "Add file" > "Create a new file" Add file button
  2. On the next screen that appears, type "license" or "LICENSE" in the file name text box. On the right-hand side, you will see the "choose a license template" button. Filling "license" in text box
  3. Click on it without any delay if you want to choose from the pre-defined licenses from there! Licenses list
  4. Choose any one of the licese and GitHub will show you the license and its simplified format. Choose according to your interest. For most projects, a MIT license will do.

  5. Don't forget to commit to add your license after doing that.

  6. Now you're all set up by making your repository contributions ready! 🎉


So, in this post you learned the importance of adding a license and that a project is even not open source if it has no license. Don't forget to visit Choose a License for more details.

I am new to the DEV community, and I got to know about DEV Community from my junior in college, Ankush Singh Gandhi. Go ahead and check out his blog for interesting posts like this on open source!

Top comments (1)

ankushsinghgandhi profile image
Ankush Singh Gandhi

Thanx for sharing