This question already has an answer here:

This is a hypothetical question, that has not happened, so please no advice. If I publish some code on GitHub with the GPLv3 license, then want to use that code in proprietary software that I will also own. Do I have the rights to use it for monetary purposes?

marked as duplicate by EMBLEM, apsillers, Glenn Randers-Pehrson, congusbongus, Tim Malone Aug 24 '16 at 4:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.