Version control systems are awesome piece of software and are really helpful in maintaining huge codes. I wanted to use such systems and even tried before, but never got any hang on it. Tortoise SVN, BitBucket, Bazaar and GitHub are some of the systems which I installed in my computer but never really used.
I recently came across an instance where I was in a desperate need to use
GitHub. I had made account long ago but had never set up a repo before. This time it was essential to make a repo and push some files as I wanted to host my website on GitHub pages. GitHub has an awesome help and support pages to get started. But the main problem is that SSH is blocked in my college because I am behind NAT (Network Address Translator). So, one of the way out was to use HTTPS for pushing to the GitHub.
Since, I was a beginner, I saw some youtube videos and googled crazily for the same but I didn’t get any accurate results and step by step technique to start with. So this is my step wise list to start using GitHub and making pushes within 10 mins. I want to thank @viranch _mehta for helping me out.These steps are for Windows but I think it will equally work for Linux.
 |
| Right click and select Git Bash |
1. You probably must have made an account on GitHub and if not, make one!
2. Follow the initial steps after making the account. Download cygwin and exe files for Windows.
3. To make a repo, click on create repo and fill in the details.
4. Now a page of settings would come. For the first timers, configure the global setting part.
Now instead of following the rest of the steps as they are for SSH, do the following:
5. Go to the directory where you want your repo to be kept locally in your computer.
6. Now right click and select “Git Bash”.
7. You will get a cmd prompt window.
8. Now just clone the repository using https by writing:
git clone https://path _of _repo
The path of the repo can be seen on the HTTP tab on the GitHub website.
 |
| HTTP address of repo |
9. Now a new folder has been created and has the name same as that of the repo in the current folder. To verify, you can see a hidden folder named .git in the repo folder. This means that git has been initialized.
10. Now copy the files which you want to commit and push in the folder created in step 9.
11. Now type the following on git bash
cd name_of_the repo
12. Now, in this step, I have assumed that you have copied the files in the repo folder.
13. Type:
git add name_of_the_files
This will add files locally.
14. Now type:
git commit –m “commit_msg”
Message is required every time you commit something.
15. Now type:
git push origin master
Provide the password. This will push your files to the Github servers and will be online within few seconds.
16. Congratulations! You have successfully pushed files in your repo. You can verify the same by going to Github website.
 |
| First time push |
Now the above steps are to be followed only during the first time when you clone a repo. Afterwards, just go to the folder (You can see .git hidden folder here) and right click to select “Git Bash”. Then do git add and git commit which you did in step 13 and 14. For pushing, just write “ git push” and it will do the pushing stuff.
 |
| For later pushes |
Hence this is a quick and simple way to start using GitHub within 10 mins