Is it legal to copy code from GitHub?
You need to include an open source license if you want others to use, distribute, modify, or contribute to your project. Unless you give them the right to do so, someone cannot legally use any part of your project in their code.