Github is a platform for hosting code repositories. In this tutorial we'll learn about using github starting from account creation all the way to pushing code from our local repo to the remote repo and vice versa.
Step- 1 Create account on Github
Start by creating GITHUB ACCOUNT . It's as simple as creating account on any other webapp, just enter the required details and you're ready to go.
Step- 2 Create a new Repository
Just fill in the details and click on Create Repository
Step- 3 Push code to your new repo
We already created a local repo in Part-1 of this tutorial. We are now ready to push that code to our newly created repo on Github.
Step- 4 Back to Git Bash
Execute the following commands exactly where you executed commands in Part-1 of this tutorial. Enter your Github username and password when prompted.
$ git remote add origin https://github.com/rishabhio/nodejs.git
$ git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 238 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
Check your repo on Github
Go back to your github account and it should have a copy of your local repo.
Congratulations, Now you can keep adding your code to your remote github repo. Its as simple as writing
Don't forget the ADD -> COMMIT -> PUSH commands for git.
Conclusion and further exploration
Well after completing this tutorial, you should be able to create more repositories and push your code to them. But there is a lot more to explore. What we covered in this tutorial is just a droplet in the ocean and therefore we suggest that you visit
following links in order to strengthen your understanding of git and github.