this post was submitted on 01 Apr 2024
36 points (92.9% liked)

Open Source

30349 readers
2284 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 5 years ago
MODERATORS
 

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?
you are viewing a single comment's thread
view the rest of the comments
[–] kevincox@lemmy.ml 1 points 5 months ago

I am not sure theres a legal way to retroactively change licenses and terms?

I don't think this is really true. If you own the code you can licence it as many times and in as many ways as you want. You just say that you are licensing existing versions and it becomes true. Probably a good idea to write that down somewhere (maybe in the LICENSE file) to make a "paper trail" in case you ever need to document this license.

You generally can't retroactively change a license, such as revoking it. But licences may have revocation terms. But it doesn't really matter what existing licences are on a code, you can always add new licences if you own it.

A silly example. If I own some code I can say "Anyone standing on their left foot can use this code". That doesn't stop me from later saying "Anyone standing on their right foot can use this code". But licenses are still valid, and I haven't change the first one. But now people can choose which license they would like to use.