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

Many of the GitHub tutorials are aimed at people who are software developers and who have used similar tools. What can seem obvious to them can seem bafflingly to you when you are trying to understand the workings of GitHub.
Most beginners don't know the importance of version management and good development practices.  
GitHub is hosting service for Git repositories. It provides nice web-GUI for repositories, but that is not its main function. It also allows a lot of project management things like you can create a Wiki for your repository, track Issues & label them etc.
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)
 
 

No comments:

Post a Comment

Genuine websites to earn money.

If you are interested in PTC sites then this article is for you. I have personally tried many of the sites and found that the best thing ...