I have previously written a lot of code that is hosted on a public repo on GitHub, but it never had a license. It was written as part of my work while working for a non-commercial academic entity, and I would like to add a license before the link to the repo will be included in something that will be made public, potentially attracting one or two visitors.

This leaves me with a couple of questions:

  1. Can I just add a license after the fact and it will be valid for all prior work?
  2. Do I have to make sure the license is included in all branches of the repo, or does this not matter? There are for instance a couple of branches that are used to freeze the state of code at a certain time for reproducibility’s sake (I know this could be solved in a better way, but that’s how it is).
  3. I have myself reused some of the code in my current work for a commercial entity (internal analysis work, only distributed within the organization). Should this influence the type of license I choose? I am considering a GPL-license, but should I go with (what I believe to be) a more permissive license like MIT because of this?
  • Dunstabzugshaubitze@feddit.de
    link
    fedilink
    arrow-up
    9
    ·
    7 months ago

    It was written as part of my work.

    check your contract, you might not own the code and your organization may have a process to determine how to license something.

    to your other questions (IANAL)

    1. prior work wont be licensed, meaning no one but the owner of the work is allowed to do anything with versions prior to the license
    2. you don’t have to, but i can’t see a reason why you should not.
    3. GPL might mean that other work depending on gpl licensed code has to be licensed in a gpl compatible way, depending on how exactly you depend on it and how you distribute your dependencies. MIT/BSD is easier here, if you don’t plan to license everything with the GPL anyway.
    • cyberwolfie@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      check your contract, you might not own the code and your organization may have a process to determine how to license something.

      Good point. I will need to double check the contract, but I believe the ownership restriction has more to do with patents and commercialization. All our output was in general meant to be made public.