Getting Start With GitHub.

Getting Start With GitHub.

You may have heard this word in many blogs related to Coding and Programming. So what is it ? GitHub is a code or Project management system or Simply Version Control which works on top of Git. Basically you need to create a Repository where you are gonna put all you source code and related media stuff. GitHub provides support for both private and Public Repository. Public repository is free of cost any one can create that but for the Private you have to Pay certain amount. If you are a student /Developer working in a team then this is quite useful to collaborate together.

If you are a student or teacher you can get Private Repository free of cost through GitHub Education -Student Developer Pack

How to get start with GitHub?

First you need to sign up for the GitHub account , While creating an account you will get two option one for the Public and another Private, If you are willing to pay and create private repository then also Fill the Payment detail and submit that , after that verify your email now you are ready to go. Follow the Picture to create an account.

Create AccountCreate Account

Click on Create Account

Chose a PlanChose a Plan

Click on Continue , next page click the submit button.

GitHub provides different interface to interact with the GitHub server.

  1. Browser

  2. CLI (Command line interface )

  3. Desktop Clients (Windows /MAC)

  4. Extension for the Different IDE (Visual Studio /Intelij….)

Most of the time you guys are gonna use the CLI , because it’s more fast and more reliable way to use.

To get star with GitHub ,Download the Desktop Client for your System which will install all the Component as well as CLI interface also.

Desktop Client Download Link

you can creates a Repository form Browser or using any other GitHub client. I personally prefer to Create a new Repository using Brower Interface. For creating the New Repository click on the New Repository/Start Project give a name to you Repository , Chose Private or Public , chose the licence if you are willing to assign licence to your Code. click on the Create button it will create a Repository for you.

Creating new RepositoryCreating new Repository

you will see some link or button written clone this or some link which has the .git at the end , jus copy that link.

Open the Git Shell type

git clone you_Link_here

example

git clone [https://github.com/zenseven123/Givi.git](https://github.com/zenseven123/Givi.git)

Hit inter it will clone your Repository to your local machine where your Git Shell is pointing you can change that to any folder and Drive. (If asking for credentials enter your username hit enter and then enter your password hit enter)

Cloning the RepositoryCloning the Repository

Now that , Repository is on your local machine , You can add the files , Folder and source code in that folder. There are certain steps which we have to follow in order to push that to the GitHub server.

First go inside that folder which you just cloned form the GitHub Server using cd FolderName

example Givi in my case

Cd Givi

Create new Files or folder using any IDE or anything in that folder

To add that file into Git type

git add yourFilename (or Simply)

git add .  (which will add all the files and folder in that Repository.)

Adding files to the RepositoryAdding files to the Repository

To know the status of the Repository type

Git status

Getting the StatusGetting the Status

and hit enter it will give you the status about file and what’s changes in it etc.

After that we need to commit that, Type

git commit -m “Write your message here what changes did you make that kind of things”

Git CommitGit Commit

hit Enter

upto this every thing is happening in your local machine only, To upload or Push that into the GitHub server to Your Repository .Type

Git push

Pusing code to the GitHub ServerPusing code to the GitHub Server

this will put that to the GitHub server.

if we make any changes in the file then then we need to commit that , after the push that to the GitHub server , and if we are adding some new file then we need to add after that commit then push .

These are the steps which we have to flow in order to save , update and create some file and add that to the Repository.

GitHub has some more Function and that is quite useful when we are working on some project and we wanna improve that in regular manner , there comes the concept of branching ,Where we can create branch from the main branch , make some change in that branch and later we can merge that with the original branch. I will write about Branching all other stuff later when I will get time . I do wanna recommend course related to GitHub

GitHub for Windows User