GitHub Part2
A simple practical session learning from zero.
Let’s start a practice session of GitHub step by step. I insist not to skip any step, at least go through it once.
The first basic thing, go to https://github.com/ and sign up here.
Once you are done with signing up, you will see a page with asking the aim to join GitHub, complete it and click next. Now you get three options shown in the picture below.
- Create Repository
- Create an organization
- Start Learning
We will start with the second option Create an Organisation.
Here you see again three options: Free, Team and Enterprise.
It’s very easy to understand the meaning of all these options. But we will select here Free option.
There are lots of benefits in Free option. In the older version only were allowed to create only public repository but with the newest one, we can use both public and private.
Let's go to the third option of Start Learning.
This option will take you to the lab of tutorials. So just click on it to enter a lab.
In this section of the Learning Lab, you will find many useful courses which are mostly free.
I would say the first Introduction to GitHub is a must-do course for more practice.
Create repository
The very important and actual start of using GitHub.
Click on Create repository, this page will display where you have set up a new repository.
- Add name (any name related to your project )which is easy to understand what it is for.
- Add a description , which is optional. I always write a few words of description for immediate understanding of its use.
- Choose Public or Private option as per requirement.
Public Repository
This repository is visible to everyone and it can also be cloned(downloaded) by non-members of GitHub.
Private Repository
This is visible only to the repository owner and the person who is invited to join this repository. This is actually very helpful like you do all your work as private and whenever you want , can change the repository status to the public.
4. Initialize README
Get Renuka KB’s stories in your inbox
Join Medium for free to get updates from this writer.
This is actually a text file in which you explain your project in brief or the tools or frameworks you have used while developing.
If you choose it, will automatically be added to to your repository and if you skip it you can add it in next step immediately.
There are 2 tabs below, add .gitignore and add a license.
These we will see in detail in coming lessons, for now, keep it none and click Create Repository.
This image shows when you select Initialize README option, your repo will immediately look like this.
This will be the next step if you don't choose Initialize README option
When you are creating a new repoository
Go to the command line or the terminal from IDE , select the path where your work is stored.
- echo “# test-1-” >> README.md
Here test-1 is the repository name, which you set in the previous step. This command actually incorporates the README file in repo by default.
2. git init
This command initializes the repo.
3.git add README.md
It adds README file in your project
4. git commit -m “first commit”
As we learned in the last lesson , we have to keep a record of what we do while uploading. This commit message can be anything but not too big.
5.git remote add origin https://…
This will add your remote project means your local machine project to the given repository link as an origin
6. git push -u origin master
This will push(upload) all your project files and folders setting origin to master branch which is the main branch of the repo and -u means updated.
Enter all these commands or you can copy-paste it one by one.
Push an existing repository
Follow these commands if already created a repository.
Import code
You can import code from another repository with this option.
In this session, I have explained all the steps in detail but we will learn more git command in the next session. Till then keep exploring and keep learning.
Stay safe , Stay positive.
Please share your views, tips and comment if you have any question.
Thank you.
(Refer to Part 1 of GitHub: https://medium.com/@renuka_kb/github-in-the-simplest-way-53c87ee2a15f)





