Git 101. Part 1

A version control system is a tool that helps a software team manage changes to source code over time.

Why Use a Version Contol System?

A VCS keeps track of all code modifications that were introduced by developers over time. If a mistake was made, developers can roll back to a previous stable version of the software.

VCSs benefits:

  • storing versions
    • VCSs allows developers to keep all versions of the software in one place. They give access to history and it usually helps to find out when, why and who introduced changes. That’s a huge help during troubleshooting.
    • each version includes a date, an owner, a commit message.
    • Given that all previous versions are saved in VCSs, developers can roll back to the last stable version.
  • collaboration
    • VCS is a source of truth for source code.
    • VCSs allow developers to work in parallel on the same code. They don’t need to warn each other about the files they are modifying. Usually, VCSs have tools to merge code if any conflicts are found.

Types of Version Contol Systems?

There are two groups of VCS: centralized and distributed.

With centralized VCS, you have a single “central” copy of a project on a server and commit your changes to this central copy. You can pull the files that you need, but you never have a full copy of your project locally. Subversion (SVN), CVS and Perforce are most known centralized VCSs.

With distributed version control systems, you don’t rely on a central server to store all the versions of a project’s files. Instead, you clone a copy of a repository locally so that you have the full history of the project. Two common distributed version control systems are Git and Mercurial.

The video below highlights differences between centralized and distributed version control systems:

What is Git?

Git is a distributed Version Control System that was created by Linus Torvalds. It’s the world’s most popular distributed version control system.

History of Git (source)

The Linux kernel is an open source software project of fairly large scope. For most of the lifetime of the Linux kernel maintenance (1991–2002), changes to the software were passed around as patches and archived files.

In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper.

In 2005 the Linux kernel community faced a daunting challenge: They could no longer use their revision control system BitKeeper and no other Source Control Management (SCMs) met their needs for a distributed system. Linus Torvalds, the creator of Linux, took the challenge into his own hands and disappeared over the weekend to emerge the following week with Git. Today Git is used for thousands of projects and has ushered in a new level of social coding among programmers.

Why is it called Git?

Picture1

“the stupid content tracker”

Linus Torvalds has quipped about the name “git“, which is British English slang for a stupid or unpleasant person: “I’m an egotistical bastard, and I name all my projects after myself. First Linux, now git.” (Note that Torvalds did not in fact name Linux.)

How Git stores data?

Most other systems store information as a list of file-based changes:

Picture2

Git thinks of its data more like a set of snapshots of a miniature filesystem:

Picture3

  • Every time you commit or save the state of your project in Git
  • Git thinks about its data more like a stream of snapshots.
  • Git tracks files not folders

 

to be continued…

Resources

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: