First, create a new repository from GitHub. Then go to git bash terminal in windows. If you have not logged in you can refer to this post. After you have logged in to GitHub type these command to create a main branch and add the code to your repository.
First go to the code folder which you want upload to GitHub and type the following command to initialize the git to your code.