Introduction

Here is a session about the version control system named Git. It's a free and open source distributed version control system. It's create by the Linux Torvalds who is the creator of the Linux kernel for the development of the kernel.

What is version control?

Imgine you are working at a final software final projects. After a series of revision, a disastrous error suddenly comes to you that you have to roll your code back to fifty steps before. But the "undo" isn't working as you think.
Imagine you are a graphic or web designer. You may want to keep every version of an image or template in order to compare different style in latter time. What would you do to record every steps of work ahead? Using different file names? Then you may have to store a incremental number of the same files and the directory of your project may look like this.

A better way is to use a version control system (VCS). It allows you to revert files back to a specific time. And also, it will give you more infomation about who last modified the content, when, where and even more.
There are three types of version control system:
  1. Local version control system
  2. It is a version control system that keeps patch sets from one change to another while working at local machine such rcs.
    image from: pro git
  3. Centralized version control system
  4. While collaborate with other developers, a centralized version control system, such as CVS, subversion, and Perforce, is needed. There is a single server that contains all the versions of files.
    image from: pro git
  5. Distributed version control system
  6. The above two version control system suffer from a big problem of curruption of the center server, that is single point of failure. Here, distributed version control system such as Git, Mercurial, Bazaar, or Darcs, provides redundancy that clients must mirror all the repository to their local machine.
    image from: pro git

Git basics

  • Nearly every operation is local
  • Git has integrity
  • Git generally only adds data
  • The three states
  • The main thing to remember about Git is the three states. There are three main sections: the Git directory where Git stores the metadata and object database (.git), the working directory which is a single checkout of one version of the project, and the staging area is a simple in the Git directory.
    The basic Git workflow goes something like this:
    1. modify file in the working directory
    2. stage the files, adding snapshots of them to the staging area
    3. commit, which takes the file as they are in the staging area and stors the snapshot permanentky to the Git directory
    image from: pro git

Conclusion

Here now, the basic ideas of Git is listed above and the following section should cover the basic operation of Git.

History

Reference

  1. Git
  2. Linus Torvalds
  3. pro git