Given the following situation:

A software project is released as open-source under a non-invasive license (e.g., BSD 2/3 clause, Apache 2, ...). During the process, the entire Git repository is made available to the community, which includes the source-code history.

During development (pre-release) as third-party library was used. This library is licensed under GPL 2 (with "copy-left"). In a later development phase the third-party dependency was removed. - Nevertheless, the Git history (partially) contains the library's source code and our own code using it.

The question is: Does this project violates GPL? - And if so, what are the necessary steps to avoid any conflicts/legal issues during open-sourcing (preferably without losing the repository history)?

  • 2
    There is generally no problem releasing code licensed under BSD license that includes GPL code. As long as you release your source code, you are already fulfilling the GPL obligations for that version. If, at some point, you have removed all GPL code from your code base, then from that point forward you are no longer bound by the requirements of the GPL license. If, however, someone downloads a past version of your software that includes the GPL code, then of course she is required to adhere to the GPL license terms when using that version.
    – Brandin
    Commented Feb 2, 2018 at 9:33
  • 1
    Even if you call it "pre-release", it is still downloadable, so the person who downloads a particular Git commit, if he gets a GPL-using version, must comply with the GPL license terms when using that version. If he gets a commit that doesn't include GPL licensed software, then he is not obligated to comply with GPL license terms, only the (say) BSD license terms.
    – Brandin
    Commented Feb 2, 2018 at 9:37
  • 1
    To make things clear, consider using release numbers to document the change clearly to users. E.g. if your pre-release versions are called 0.6.1, 0.6.2, 0.6.3, ... Then you could say in your release notes that as of release 0.7 there is no longer any GPL code, and that the project is purely (say) BSD at that point.
    – Brandin
    Commented Feb 2, 2018 at 9:39
  • 1
  • Thank you, that helps alot. - In particular I wasn't aware of "As long as you release your source code, you are already fulfilling the GPL obligations for that version."
    – H L
    Commented Feb 4, 2018 at 18:04

3 Answers 3


With respect to the other answers, I disagree with them.

You have developed some code, which you have released under a non-copyleft free licence; let's pick BSD 3-clause (BSD3). The choice doesn't affect the answer all that much, but it's easier than dealing with a list of possible licences.

At some point in the development of your project, you have linked in a library that is covered by GPLv2. Now, when you distribute the resulting project, GPLv2 s2b requires that you do so under GPLv2. This doesn't violate BSD3, which has no requirement that you not do this. Some would hold that this is re-licensing, but as I argue elsewhere it it not: it is adding additional conditions to the conveyance, over and above those which BSD3 imposes, which BSD3 does not forbid.

The FSF are clear that you may still continue to release your code on its own under BSD3. But when you release the whole project (including the library) you must do so with the conditions of GPLv2 applying to all of it. If you do not, then yes, you are violating the library's copyright licence.

The question of removal of the library then arises. Some (including me) would argue that by Ship of Theseus the version with the library removed is a derivative of the previous version with the library in and thus still subject to GPLv2. Others, such as Brandin in his excellent comments above, would disagree, and claim that once the GPL library was removed, the GPL obligations on derivatives would lapse. I'm not aware of any jurisprudence on the subject that can help us say which is the most likely interpretation, and it would depend on your jurisdiction anyway.

Of course, if you're still publishing the original, pre-GPL-library version under BSD3 (see above), and also your new-non-GPL library patches under BSD3, someone else could combine them and produce a version of the project that had never seen the GPL library, which would have a very strong claim to be releasable under BSD3 in its entirety.


Yes, this project most probably violates the GPL?

By making the entire Git repository available to the community you also publish these early versions. Every publicly available commit constitutes a source code release.

And while one can include for example Apache 2.0 licensed code in a GPL 3.0 project, it's not possible the other way around, which is what you effectively created. By linking to a GPLed library you already create a derivative work. See GPL compatibility for more information.

In order to avoid any conflicts/legal issues you need to remove those commits from the publicly available source history, for example by pruning the source history from the beginning until the GPL library was removed or by squashing the commits between the introduction and the removal of the library. In any case the repository history of the public repository needs to be changed so that no version that uses on the GPL-ed library is available anymore. The implementation depends on the source repository system in use.

Privately you can of course keep the repository as it is.


More importantly, this project violates the copyright law.

Basically you have to remove/rewrite all code that was under GPL v2, if necessary, go back in time before that library was introduced.

Because you don't want to violate BSD nor Apache licenses either.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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