Can I use the code in a GitHub project which does not have a license specified?

Say that a public GitHub project does not have a license specified. Can I use that code in my own code? If I can, under what licenses can I distribute my code? Can I use any open source license?


Say that a public Github project does not have a license specified. Can I use that code in my own code?

You can not say as you don't know the licensing terms. You first need to ask the owner of the project what's allowed or not.

The meaning of a public Github repository is specified by Github as the following:


Public Repositories can be viewed and cloned by anyone. Choose this if your repository:

  • is an open source project
  • should be easy for other members to fork and contribute back their modifications

  • The meaning of "open source project" is not really saying much more that you can read the source code publicly. Which is then a pre-condition to fork a repository so the second point is pretty redundant and not adding anything in clarification of usage rights. It says even "should" which is saying nothing concrete.

    If I can, under what licenses can I distribute my code?

    If you can, then the original author(s) would have told you that.

    Can I use any open source license?

    It depends on the legal status you want to achieve ^^. Generally I can not suggest you to do that at all.

    You should really find out first which license applies. That can be done by contacting the original author. Next to that you can ask the original author to make the license more prominent to make re-use of the code easier for others.

    This will help you as well if others are questioning the use rights of your derivate later on.


    Say that a public github project does not have a license specified. Can I use that code in my own code?

  • No , if software is published without a license granting you rights to distribute that software, then in most countries you have no rights to distribute that software.
  • Just because it is available for download doesn't mean that it is in the public domain. In fact it is protected by the WIPO Copyright Treaty and thus the Berne Convention even if it is downloadable and even if it doesn't include a copyright notice - copyright is attached automatically on creation.

    Can I use any open source license?

  • No , any license you try to attach to that code would be void. Since you do not own copyright on the material, you cannot assign rights over that code to others.
  • Note that it can be legal to download without being legal to distribute it further. The fact that code has been uploaded to github gives you the rights listed in the github terms and conditions but no more. In other words, you can view and fork (copy/download) a github repository, but you cannot distribute that content without a licence which grants you further rights.


    When in doubt, ask the author to specify his license.

    For very open licenses (eg BSD, MIT, ...), you can do whatever you want as long as the license is intact in the source (+ not using the author names as endorsement, ...).

    For copy-left licenses (eg GPL), your license has to be GPL-compatible, which probably means GPL as well.

    For commercial licenses (probably not the case if the Github project is public), have someone (typically a license lawyer) read through the license with you to understand what is your liability for using this piece of code.

    Now for your case, if you are developing a hobby project which you are not planning on making money out of in the near future, go with the BSD license and use that Github project. And please put a license file in your source tree.

    链接地址: http://www.djcxy.com/p/79712.html

    上一篇: 将许可证文件附加到OSX下的dmg

    下一篇: 我可以在没有指定许可证的GitHub项目中使用代码吗?