How to use git

Git is a very popular open source version control system, it keeps history and track of you work, development job you are doing.

If you are a developer guy part of a team or if you use different machines to work in the daily basic then you need to learn and work with git.

The basic content of GIT it is BLOB ( binary large objects). The data are structured like trees. Every tree contain other trees. Every file of git is considered like a history of the project modification.

In this way you keep track of the modification your team or you do. If you keep track of the data modification then you can find also the persons who made the mistakes 🙂 . The official website of git is github.com when you can upload all you projects, be careful this can be viewed also from others, also they can contribute on making your projects better.

In order to have private projects you need to register on other sites like:

In this tutorial we will work with github.com for a demonstration how git works.

First of all lets create an account at github.com clicking at “Sign up” button.

Second create a new repository clicking “New repository”, at “Repository name” write down the name of your project without spaces, a single name will be fine.

If you need a free service ( open to the public ) leave it “Public”, if a payed service than you can choose a private project.

OPTIONAL :

You can choose to add a README txt

You can choose to add also a excluded file in order not to be downloaded from your team.

If you want to add a license for your project also this is a good time to add it.

At the end click “Create repository”.

You will see another step ( Quick Step ) if you need to create a new project or to push ( upload ) a actual one. In this case we will start a new project.

In order to start we need to have installed on our machine,

if you have ubuntu / linuxmint than open you terminal and write down the command:sudo apt-get install git
if you have centos / redhat than type:yum install git
Next create a folder somewhere on your directory and enter on it via terminal.

In order to initialize git write the command:git init
Now git is initialized and need to link to our repository on github. Writing down ( via terminal ) this command:git remote add origin git@(the link displayed )
In this point the folder it is linked to our online repository. Let’s see some of the daily command you will use using git:git add .
This command add the new files, for example if you created a new file this will not be added automatically. This command include the new files to the repository.git commit -am 'name of the changes here'
Before you push (upload ) to your repository first need to memorize the changes you did, kind of git memory