1. First create a directory locally, and then enter the directory. For example, I create a Code folder on my D drive and put the code I want to upload in this folder.
2. Then enter the path in Git Bash
Command: $ cd D:/blog/Code
3. Then initialize it
Command: $ git init
4. Add all files of the local project workspace to the staging area
Command: $ git add .
5. Submit the files in the staging area to the local warehouse
Command $ git commit -m "excu"
6. Associate the local repository to Github
Command: $ git remote add origin http://github.com/username/reponame.git
7. Upload the code from the local repository to the Github remote repository. Note here that you will be asked to enter your githu username and password.
Command: $ git push -u origin master
If you come here, it means that you have succeeded, go to your github repository and have a look!
You can see that your code is already on the github repository.
{{o.name}}
{{m.name}}