Starting with Git on Linux (Part 1)

Git is the most used version control system. Firstly, Git was developed for Linux kernel development by Linus Torvalds in 2005. Like the Linux kernel, Git is free and is distributed under the terms if the GNU General Public License version 2.

But before starting with Git, let me tell you what is version control. Version control is a system that records changes to a file or set of files over time, so if you want you can call these versions later.

Features

Every developer should know how to use Git. Git got some awesome characteristics, let’s see them below.

Strong support for non-linear development

Git supports rapid branching, merging and includes specific tools for visualizing and navigating a non-linear development history. A branch in Git is only a reference to a single commit.

Distributed development

Git gives each developer a local copy of the entire development history, and all these changes are copied from one such repository to another. These changes are imported as additional development branches, and can be merged in the same way as a locally developed branch.

Compatibility with existing systems/protocols

Repositories can be published via HTTP, FTP, rsync, a Git protocol over either a plain socket or even ssh. For more, Git also has a CVS server emulation. It enables the use of existing CVS clients and IDE plugins to access Git repositories.

Efficient handling of large projects

Linus Torvalds has described Git as being very fast and scalable. Performance tests done by Mozilla showed it was faster than some other version control systems.

Cryptographic authentication of history

The Git history is stored in such a way that the ID of a particular version (a commit in Git terms) depends upon the complete development history leading up to that commit. Once it is published, it is not possible to change the old versions without it being noticed.

Garbage accumulates unless collected

Aborting operations will leave useless dangling objects in the database. These are generally a small fraction of the continuously growing history of wanted objects. Git will automatically perform garbage collection when enough useless objects have been created in the repository.

How to install Git on Linux (Most types of Distros)

Open the terminal and run the command accordingly to your distro.

Debian/Ubuntu
$ apt-get install git

Fedora
$ yum install git

Gentoo
$ emerge --ask --verbose dev-vcs/git

Arch Linux
$ pacman -S git

openSUSE
$ zypper install git

FreeBSD
$ cd /usr/ports/devel/git
$ make install

Solaris 11 Express
$ pkg install developer/versioning/git

OpenBSD
$ pkg_add git

In this part, we learned what is Git, its features and how to install. At part 2 we will talk about starting with Git and some basic commands.

This article is part of the series Starting with Git on Linux.