reading-notes

Reading 02b summary

Git Tutorial

In order to explain Git, we have to first explain various aspects of Version Control.

Version Control Version Control is a system that allows you to revisit various versions of a file or set of files by recording changes. Through version control, one can

1. Local Version Control

2. Centralized Version Control

Centralized Version Control

3. Distributed Version Control

Distributed Version Control

Git

is a DVCS that stores data in a file system made up of snapshots. Each time you save a changed version of your project — called commit — Git creates a snapshot of the file and stores a reference to it. If the file has not changed, Git only stores a reference to the already-stored identical version of it.

  1. Relies on local operations because most necessary information can be found in local resources.

  2. Detect file corruption or loss of information in transit.

  3. Minimize the possibility of irreversible damage to files.

States

states

#### The local Git repository has three components:

  1. Working Directory: The actual files reside here.
  2. Index: The area used for staging
  3. Head: Points to the most recent commit image

Saving Changes

All files in a checked out (or working) copy of a project file are either :

Tracked Tracked files can be modified, unmodified, or staged; they were part of the most recent file snapshot
Untracked Untracked files were not in the last snapshot and do not currently reside in the staging area.

After cloning a repository, files have tracked status and are unmodified because they have been checked out but not edited.

The Life Cycle of File Status

image