First of all, it’s important to understand the background about the origination of Git. For that, we have to know what is version control system and types of version control tools. Also, comprehend how and where Git can be employed.
Introduction to DevOps
Introduction to Linux Systems and SubSystems
What is Version Control?
The Version Control Systems(VCS) can be defined a component of software configuration management, which records the changes to a file or set of files so that it can be recalled in future. However, the primary use of Version control is to **Track changes**
A version control system is mostly based on one concept which is tracking changes that happen within directories or files. Depending on the version control system, this could vary from knowing a file changed to knowing specific characters or bytes in a file that have changed.
In most cases, you specify a directory or set of files that should have their changes tracked by version control. This can happen by checking out (or cloning) a repository from a host, or by telling the software which of your files you wish to have under version control, the set of files or directories that are under version control is more commonly called a repository. The process will be transparent to you until you are ready to commit those changes.
Types of version control systems
Now that we know about VCS, let’s study the types of VCS and learn about each topic in detail. VCS can be classified into three main categories:
- Local VCS
- Centralized VCS
- Distributed VCS
Local VCS normally resides only on the local machine of a developer. This system mainly assists to track changes made by the developer on his machine. Also, these changes are complex to share externally in “VCS” format (meaning change history, version numbers etc.,).
However, this type of VCS has minimal contribution and usability in teams with size >1 member.
The most common and popularly known version control systems are centralized, including Subversion (SVN) and Perforce
Centralized version control systems are grounded on the theory which defines the existence of single “central” copy of any considered project someplace (perhaps on a server), and developers will “commit” changes to this central copy.
“Committing” a change can be defined as recording the change in the central system.
External programmers can only view this change. The changes can be pulled down and the version control tool will inevitably update the contents of any and every file that was modified.
Overview of Centralized VCS workflow
The typical workflow for adding a new feature or fixing a bug in your project, employing the centralized VCS is described below:
- Pull: Pull down any changes from external entities through the central server.
- Change: Execute the changes, and validate the execution.
- Commit: Commit your changes to the central server, so other programmers can see them.
In distributed VCS, each user is allotted a separate repository and working copy. This allows the developers to work on a given project without requiring them to share a common network. For changes to be accessed in a commonplace, following commands must be executed
- You commit
- You push
- They pull
- They update
Note: The commit and update command only move changes between the working copy and the local repository, without affecting any other repository. However, the push and pull commands move changes between the local repository and the central repository, without affecting your working copy.
As the concepts in VCS are familiar, let us understand the details about Git
What is Git?
Git is a free and open source distributed VCS designed to handle the whole shebang, from small to large projects with consistent speed and efficiency.
As per creator of Git:
Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.
Git was created by Linus Torvalds in 2005 for development of the Linux kernel, with other kernel developers contributing to its initial development.
Features of Git
Git seems to the buzz, and knowing about the trending topics is always a wise choice. Let’s understand the features of Git. Also, how it is beneficial and different when compared to the competition
- Economical: Git is Free to use and modify.
- Open Source: Git is released under the GNU GPL2.0. This is an open source license and guarantees freedom to share and change.
- Trivial and Swift: With Git, nearly all operations are performed locally. This gives a huge speed advantage by cutting down on any client-server communication. Git is written in C, which reduces the overhead of runtimes associated with higher-level languages.
- Distributed: As we have discussed before, Git is a distributed VCS. Distribution of repositories also ensures humongous redundant backups, which can come handy to restore in cases of disasters.
- Quick Branching: Create as many branches as you want, as frequently as you want, and share them with as many people as you want and Git won’t break a sweat.
- Adaptable Workflow: User has the liberty to choose the workflow.
Git is the one-stop solution for all development related problems. This was discussed on our first blog. Git provides all the Distributed VCS facilities to the user that was mentioned earlier. Git repositories are very easy to find and access.
By employing Git, it is easy to
- Collaborate with development team and partners
- Track changes to the codebase.
- Restore older versions of documents/codes in case of a mishap.
- Enable Continuous integration with Jenkins. Any new change in the codebase can trigger the built-in Jenkins and which acts a quality check.
- Backup of the codebase with history.
For further updates, keep visiting www.acadgild.com