DEV Community

What License Should You Use on GitHub? Understanding MIT, Apache, GPL, and More

A GitHub LICENSE file is a crucial legal document defining how others can use your code. Without a license, all rights are reserved, hindering collaboration and adoption. Choosing a license clarifies usage rights and encourages contribution. Permissive licenses like MIT and Apache 2.0 allow broad reuse, even commercially, requiring only attribution. Copyleft licenses, such as GPLv3 and AGPLv3, mandate that derivative works remain open-source. MIT is simple and highly permissive, while Apache 2.0 adds patent protection. GPLv3 ensures open-source continuity, and AGPLv3 extends this to web services. The choice depends on desired freedom levels and open-source requirements. Adding a LICENSE file involves pasting the license text into a file in your repository's root directory. For non-code content, Creative Commons licenses are more appropriate. This information is for guidance only; consult a legal professional for critical matters. Proper licensing safeguards your work while fostering community growth.
favicon
dev.to
dev.to
Create attached notes ...