First, open the project in Visual Studio.
Then add the project to Source Control.
Then go to Team Explorer. You have two options here. Either publish to Visual Studio Team Services or Git remote repository. Here we are publishing it to Github repository. Therefore I will select "Publish to Remote Repository"
When click on "Publish Git Repo", there appears a text box to enter Git repository URL. Login to your Github account and create new repository.
Copy Repository URL.
Paste it in Visual Studio Team Explorer text box. Finally publish it.
You're done :)