I usually work with public open source repos and I am in the habit of adding a license.md file to such repos.

However, I am currently working on a private repo and wondered whether a license.md file is recommended or whether its pointless given that the repo is private. If a license file is recommended please could you explain why.

Any input gratefully received. Thanks in advance.

Please note this question strictly relates to private repos not public ones.

  • 4
    Does this answer your question? What can I assume if a publicly published project has no license?
    – Lanting
    Jan 26 '21 at 12:18
  • 1
    This question strictly pertains to private repos - however, your linked post is useful to know in case I ever go public - thx
    – danday74
    Jan 26 '21 at 14:11
  • 1
    Nevertheless the answers to the linked question also hold in the general case: source code without a stated license isn't implicitly public domain/open source. Someone can't steal your code because you didn't add a license file.
    – Lanting
    Jan 26 '21 at 14:17

If you are 100% certain that you will never publish your code, then you will also never need to add a license. But that kind of software is not called open source ;)

However, if chances are that you will eventually gain the confidence to disclose your project you should add it as early as possible to have it in your whole git history. You always publish your whole git history and if someone decides to check out older revisions, they might be confronted with copyrighted code. You could also rebase a licence into the whole repo, but why not do it right at the start.

  • 4
    This. It never hurts to be clear to oneself under which condition one would be willing to share own work. And why not document that with (preferably one of the commonly used) licenses? Jan 26 '21 at 9:34
  • 3
    If private work does not contain a licence, and you wish to make it public, it might even be pertinent to rewrite the history to add a licence file at the initial commit. See for example: opensource.stackexchange.com/questions/6945/…
    – cmbuckley
    Jan 26 '21 at 14:39
  • Well okay that's the case if you want to restrict the usage and prevent users from using the old license. If the previous license is general copyright without explicit licensing, it just prevents people from using old revisions at all Jan 26 '21 at 15:20
  • 1
    Also if you are 100% confident that there is no possibility of anybody exfiltrating material from your repository and then claiming that since it was unidentified it was unowned. There's multiple archaic OSes etc. that the originators have lost control of because they didn't place an explicit statement of ownership/copyright in every file. Jan 26 '21 at 17:20
  • @MarkMorganLloyd Putting a license file doesn't protect you from that, though. Just as how they can change the authorship information in the commits, they can also change the license text. Real protection against that would be registering the copyrighted work with a government or other third party (WaybackMachine?) that can support your claim as the originator. Or becoming well-known enough. In the case of those archaic OSes, I imagine they didn't have commits with authorship info attached, while a repo today would include that automatically.
    – JoL
    Jan 26 '21 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.