A Guide to GitHub Licenses for Beginners

Olumide AdeolaOlumide Adeola
8 min read

GitHub is not just a platform for hosting and collaborating on code; it's also a place where open-source software is shared and collaboratively developed. When you contribute or use code from repositories, it's crucial to understand the licensing terms associated with the project. GitHub offers a variety of licenses, each with its own implications for how you can use, modify, and distribute the software.

In this guide, I will explore some of the most commonly used GitHub licenses and provide insights for beginners.

What is a License in Programming ?

A license is a legal instrument that defines the terms under which software can be used, modified, and distributed. GitHub provides a standardized way for project maintainers to specify the license they want to apply to their codebase.

What absence of a license may mean ?
The absence of a license does not mean that the code is free to use; in fact, it implies an "all rights reserved" status, making it challenging for others to use or contribute to the project.

Common Github Licences

MIT License:

  • Permissive: The MIT License is one of the most permissive licenses, allowing users to do almost anything they want with the code, as long as they include the original copyright and license notice.

  • Use cases: Well-suited for projects that want to maximize flexibility for developers and encourage broad adoption.

      MIT License
    
      Copyright (c) [year] [author]
    
      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.
    

GNU General Public License (GPL):

  • Copyleft: The GPL is a strong copyleft license, meaning that any derivative work must be distributed under the same license terms. It ensures that modifications and improvements to the code also remain open source.

      GNU General Public License v3.0
    
      Copyright (C) [year] [author]
    
      This program is free software: you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation, either version 3 of the License, or
      (at your option) any later version.
    
      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      GNU General Public License for more details.
    
      You should have received a copy of the GNU General Public License
      along with this program. If not, see <https://www.gnu.org/licenses/>.
    

Apache License 2.0:

  • Permissions: This license grants permissions to use, modify, and distribute the software, but it also provides an express grant of patent rights from contributors to users.

      Apache License 2.0
    
      Copyright (C) [year] [author]
    
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
    
          http://www.apache.org/licenses/LICENSE-2.0
    
      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    

BSD 3-Clause License:

  • Permissive: Similar to the MIT License but with an additional clause preventing the use of the name of the project or its contributors to endorse or promote products derived from this software without specific prior written permission.

      BSD 3-Clause License
    
      Copyright (c) [year], [author]
    
      Redistribution and use in source and binary forms, with or without
      modification, are permitted provided that the following conditions are met:
    
      1. Redistributions of source code must retain the above copyright notice,
         this list of conditions and the following disclaimer.
    
      2. Redistributions in binary form must reproduce the above copyright notice,
         this list of conditions and the following disclaimer in the documentation
         and/or other materials provided with the distribution.
    
      3. Neither the name of the copyright holder nor the names of its
         contributors may be used to endorse or promote products derived from
         this software without specific prior written permission.
    
      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
      LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
      CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      POSSIBILITY OF SUCH DAMAGE.
    

Creative Commons Zero v1.0 Universal (CC0 1.0 Universal):

  • Public Domain: This license allows creators to waive all their copyright and related rights, effectively placing their work in the public domain.

      Creative Commons Zero v1.0 Universal (CC0 1.0 Universal)
    
      The person who associated a work with this deed has dedicated the work to the
      public domain by waiving all of his or her rights to the work worldwide under
      copyright law, including all related and neighboring rights, to the extent
      allowed by law.
    
      You can copy, modify, distribute and perform the work, even for commercial
      purposes, all without asking permission.
    

Eclipse Public License 2.0:

  • Business-Friendly: Designed to be business-friendly while still preserving the integrity of the open-source process.

      Eclipse Public License 2.0
    
      Copyright (c) [year] [author]
    
      Licensed under the Eclipse Public License version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
    
          https://www.eclipse.org/legal/epl-2.0/
    
      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    

Mozilla Public License 2.0:

  • Copyleft: Similar to the GPL but tailored for use with software distributed by Mozilla.

      Mozilla Public License 2.0
    
      Copyright (c) [year] [author]
    
      This Source Code Form is subject to the terms of the Mozilla Public
      License, v. 2.0. If a copy of the MPL was not distributed with this
      file, You can obtain one at http://mozilla.org/MPL/2.0/.
    

SIL Open Font License 1.1:

  • Fonts: Specifically designed for open fonts.

      SIL Open Font License 1.1
    
      Copyright (c) [year], [author]
    
      This license is copied below, and is also available with a FAQ at:
      http://scripts.sil.org/OFL
    
      -----------------------------------------------------------
    

The Unlicense:

  • Public Domain: This is more of a template for dedicating your work to the public domain, waiving all your copyright and related rights.

      The Unlicense
    
      This is free and unencumbered software released into the public domain.
    
      Anyone is free to copy, modify, publish, use, compile, sell, or distribute
      this software, either in source code form or as a compiled binary, for any
      purpose, commercial or non-commercial, and by any means.
    

Zlib License:

  • Permissive: A very simple permissive license used mainly for software libraries.

      Zlib License
    
      Copyright (c) [year] [author]
    
      This software is provided 'as-is', without any express or implied
      warranty. In no event will the authors be held liable for any damages
      arising from the use of this software.
    
      Permission is granted to anyone to use this software for any purpose,
      including commercial applications, and to alter it and redistribute it
      freely, subject to the following restrictions:
    
      1. The origin of this software must not be misrepresented; you must not
         claim that you wrote the original software. If you use this software
         in a product, an acknowledgment in the product documentation would be
         appreciated but is not required.
    
      2. Altered source versions must be plainly marked as such, and must not be
         misrepresented as being the original software.
    
      3. This notice may not be removed or altered from any source distribution.
    
NB
There licenses touched upon here are just a select few among the many others available. Choosing the right license depends on the goals and requirements of your project. You may even consider seeking legal advice if you're uncertain about which license to choose.

Choosing a License:

When selecting a license for your project, consider the following factors:

  • Project Goals: Choose a license that aligns with your project's goals. If you want widespread adoption and contribution, a permissive license like MIT might be suitable. For a strong commitment to open source, a copyleft license like GPL may be preferred.

  • Community and Collaboration: The license you choose can affect how others contribute to your project. Some developers may be more inclined to contribute to projects with permissive licenses.

  • Legal Implications: Understand the legal implications of the license. For instance, copyleft licenses have strong requirements for derivative works, while permissive licenses are more lenient.

Applying a License on GitHub:

Adding a license to your GitHub repository is straightforward. Follow these steps:

  1. Choose a License:

    • Decide on the license that best suits your project.
  2. Create a LICENSE File:

    • Create a file named LICENSE in the root directory of your repository.
  3. License Templates:

    • GitHub provides license templates. You can choose one, copy its contents, and paste them into your LICENSE file.
  4. Commit and Push:

    • Commit the changes and push them to your repository on GitHub.

Conclusion:

Understanding GitHub licenses is essential for both contributors and maintainers. It sets the expectations for how the code can be used and shared. As a developer, always check the license of a project you're contributing to or using, and as a project maintainer, carefully choose a license that aligns with your project's goals.

Feel free to comment, like and ask further questions

My Online Portfolio

My Twitter handle

0
Subscribe to my newsletter

Read articles from Olumide Adeola directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Olumide Adeola
Olumide Adeola

Classical | Health | Academics | Services et Solutions | Finance | Agriculture | Technology This is what my passion revolves round....