20

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.

danday74
  • 311
  • 1
  • 2
  • 8

1 Answers1

19

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.

eeucalyptus
  • 974
  • 4
  • 15
  • 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? – planetmaker Jan 26 '21 at 09: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: https://opensource.stackexchange.com/questions/6945/if-i-change-the-license-of-my-project-can-someone-use-the-old-license-by-naviga – 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 – eeucalyptus 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. – Mark Morgan Lloyd 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
  • "You always publish your whole git history" This is quite a strong claim, especially as OP doesn't even mention that they're using git. And you can of course just publish any subset of data regardless of what earlier versions you have stored and how. – JiK Jan 26 '21 at 22:30