
How to Add an MIT License to Your GitHub Repository
How to Add an MIT License to Your GitHub Repository
If you are building a serious project and pushing it to GitHub, adding a license is a small but important step.
A license tells other people what they can and cannot do with your code.
Without a license, your project may be public on GitHub, but that does not automatically mean people are allowed to use, copy, modify, or distribute it freely.
That is where the MIT License comes in.
What is the MIT License?
The MIT License is one of the most popular open-source licenses.
In simple words, it says:
“You can use this code, modify it, copy it, sell it, and use it in your own projects — but keep the license and copyright notice.”
That means people can use your project freely, but they still need to give basic credit by keeping your license file.
Why use the MIT License?
The MIT License is good when you want your project to be:
- Easy for others to use
- Open source
- Beginner-friendly
- Simple to understand
- Usable in personal, commercial, or serious projects
It is commonly used for libraries, tools, templates, websites, apps, and open-source projects.
What does the MIT License allow?
With the MIT License, people can:
- Use your code
- Copy your code
- Modify your code
- Share your code
- Use it in commercial projects
- Include it in private projects
But they must keep the license and copyright notice.
Important beginner note
Adding an MIT License does not mean you lose ownership of your project.
You still created the project.
The license simply gives others permission to use it under specific rules.
How to add an MIT License to a GitHub repo
Follow these steps:
- Open your GitHub repository.
- Click Add file.
- Click Create new file.
- Name the file:
LICENSE- Click Choose a license template.
- Select MIT License.
- GitHub will add the license text for you.
- Review the file.
- Click Commit changes.
That’s it. Your repo now has an MIT License.
MIT License template
Your LICENSE file will look similar to this:
MIT License
Copyright (c) 2026 Your Name
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Replace:
2026 Your Namewith your current year and your name, username, company, or project owner name.
Example:
Copyright (c) 2026 Manish VishwakarmaShould every GitHub repo have a license?
If it is just a private experiment, maybe not.
But if your project is public, serious, open-source, or something you want others to use, then yes, adding a license is a good idea.
Without a license, people may not clearly know whether they can use your code or not.
Useful links
- GitHub Docs: Adding a license to a repository
- GitHub Docs: Licensing a repository
- Choose a License: MIT License
- Open Source Initiative: MIT License
Final thoughts
The MIT License is a simple way to make your project open-source and usable by others.
For most beginner-friendly open-source projects, templates, tools, and small apps, MIT is a clean and practical choice.
Just add a LICENSE file, choose MIT, commit it, and your project becomes much clearer for everyone who visits your GitHub repo.