Tutorial One: Git Basics

01:23:00 0 Comments A + a -

Git history: 


Git is a version-control system that was developed by the Linux-open source community under the guidance of Linus Travolds. It mainly aimed at solving some of the problems they faced with Bitkeeper a Distributed Version Control System used back in 2005.

The major problems Git addresses are:
    

1. Speed
2. Simple design
3. Strong support for non-linear development(thousands of parallel branches).
4. Fully distributed. 
5. Able to handle large projects like the Linux kernel efficiently(speed and data size).
6. Easily manageable code for a team or by any number of developers. 

Git basics: 


Repository:

A working copy of the project is stored as a git repository/directory either on your local machine or to an upstream repository(either hosted on a server or an online repository like github, bitbucket etc.). it contains the history of your commits, different versions over time, different tags and branches local to that repository.

A normal directory can be made into a git repository by using the command 'git init' which is covered under git commands.

Stage:

Staging or Index area holds the snapshots of the changed files of the working tree. The snapshots are considered as the contents of the next commit. Stage is used mainly to easily revert to previous commits. It is strongly recommended to stage your files using 'git add' but you can also directly commit without staging the files.

Working tree:

The user could create, modify or delete files and this collection of files is called the Working tree. You can work on the working tree by modifying content and committing the files to the git repository using 'git-commit'.

Branches and Tags:

A branch is a name given to a commit. When you create a new commit the branch points to the latest commit along with the history of the previous commits. In short it is a successor to a series of commits and each commit knows its predecessor. A tag is a name given to a particular commit at a point where one can identify a particular change or commit.

There are mainly three stages of git version control system:

1. Making a local repository or directory.
2. Staging the files and taking snapshots.
3. Committing your project to a upstream/central repository.

                                       

                                 Git Version Control System 



Git Installation: 

If your ready to get your hands dirty, you can install git from here. This link will provide a complete understanding about installation of git for the OS you are running.

Stay tuned for "Tutorials two: Git Basics" where I will be explaining some important commands and keywords and what they mean.


Disclaimer: The tutorial is based on Git and I'm only blogging about it. I do not hold any copyrights to the tool.

P.S- Image courtesy Janani Vasabhaktula


Android Developer, Tech Enthusiast, Startup Aficionado, Seeker of Happiness.