Tuesday, December 14, 2010

How to use GIt



I have been working on project which uses GitHub as source control tool. so i thought of sharing my experience on working with this tool.

When i am asked to use this tool for the project i was thrown away by the number of commands that are necessary to work with GitHub, so i started learning it by my self from the scratch and here is step by step guide for you to learn it with real example.

First create account at github.com

after creating account , it will take you to this page
then you create a repository.Thereafter it will take you to this page.


if you are working on windows operating system then you need to download Git and install it on windows environment.

download the suitable GitHub version and install it on your operating system. since i am working on windows operating system i have downloaded .exe setup file. After installation is done ask your self why do i want to download and install it. it is because, all the source control activities are done through this interface here after. this GitBash is very much similar to linux shell.

Now comes the most important steps.



whatever the project first you have follow the following steps to configure your machine to your git account.

How what do you want to do, this is the problem i had at first. i have git account and git bask running on my machine, now i want to work with github.com account i have created using git bash.

One way, i have project on my computer and i want to put that in to github

This is how you do it,







So here we go ....


First tell git who you are: git has many users , so when you are connecting to make source control of your source on git, let it know about you to point to your project source :P



Hey, git, here is my name and email.

git config  user.name "Your Name" git config  user.email kapila@ntp.org

You can understand this from the following example also. Say you are working on a project which has 100 developers. 
So you are the program manager and , what you first do is create git account in github.com, this has nothing to do with 
your local machine. 


or else , first create new project in remote repo and then make a pull. 

here goes how you do it
following window shows how you create new repository. 

it will point you to the following window.
it says, what to do next. so you have project that is sync with github and all your source code reside in github nowww!