What is GitHub for a beginner and how to get started with it?

Answer by Mayuresh Waykole:


I understand what you have been facing.
Lets start with a few basics shall we ?
Terminology :

Repository : A repository is a folder inside which you are going to store                            every piece of your code
Fork : Copying someones repository into your account is called forking.
Upstream : The guy or organisation which owns the code that you forked.

1. What is Git ?

Version Control System ( Keep reading and this will make sense towards the end ) .
Lets say you have a project you want to work on.
Now you have 2 primary motives.
          (a)  To write some code
          (b)  To take up the project as a team , meaning that more than  one                           people are going to be responsible for writing the code.

So suppose you write a "Hello World!" program and then your friend/other developer decides that it should say "Hello, I am awesome"
instead of the original "Hello World!".

Even for this little piece of code, you will have a copy in your PC and your friend will have one in his PC.
Lets say you change the code, now at this point your friend wouldn't know the changes you have made and vice versa.

This is where the Git magic comes. 
    1. Git lets you save your code online.
    2. Git will allow all the developers of a project to see what changes                         the  other one has made.
    3. It allows you to discuss issues in your code with other developers.
     And a lot more…

I think now you have a decent idea of what git is.

2. Getting Started

First, Signup on Github.
-> Next, Download git for you OS from this page Git – Downloads
-> Next you go and do this   Create A Repo · GitHub Help

So now you have created a repository Online, and you have installed git on your PC. Until now they are not linked to each other.

-> To do that follow the instructions under "setting up git" Set Up Git · GitHub Help

Setting Up is done !!

3. One step ahead

If you forked someones repository ( Forked , explained under terminology, scroll up ) then follow these instructions Fork A Repo · GitHub Help and then the commands below.

If you are the upstream yourself ,( ie. you are the guy who created the original repository ) then follow the instructions below

$ git clone <add the repository address here>
( Clones/copies everything from that repository to your local machine )
$ git add filename.extension
(this adds the file you want to change on the server)
$ git commit
(this commits your changes to the repository with an explanation message)
$ git push origin master
(this finally sends all your changes to the server. This is the final step of changing the code on your repository on the server)

You just started using github. Congratulations 😀

What is GitHub for a beginner and how to get started with it?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: