You are on page 1of 6

Git

What is Git?
Version Control
Version control is a system that records changes to a file or set of files over
time so that you can recall specific versions later. It allows you to:

Revert files back to a previous state

Revert the entire project back to a previous state

Compare changes over time

See who last modified something that might be causing a problem

Who introduced an issue and when

And more.
Distributed Version Control Systems
In a DVCS (such as Git, Mercurial, Bazaar
or Darcs), clients don’t just check out the
latest snapshot of the files: they fully
mirror the repository. Thus if any server
dies, and these systems were
collaborating via it, any of the client
repositories can be copied back up to the
server to restore it. Every clone is really a
full backup of all the data.
Git
Basics
Nearly Every Operation Is Local
Most operations in Git only need local files and resources to operate – generally
no information is needed from another computer on your network.

Git Has Integrity


Everything in Git is check-summed before it is stored and is then referred to by
that checksum. This means it’s impossible to change the contents of any file or
directory without Git knowing about it. This functionality is built into Git at the
lowest levels and is integral to its philosophy. SHA-1 Hash:

24b9da6552252987aa493b52f8696cd6d3b00373
The Three States
1. Untracked Files

2. Staged Files

3. Modified Files
The basic Git workflow goes something
like this:
You modify files in your working
directory.

You stage the files, adding snapshots of


them to your staging area.

You do a commit, which takes the files as


they are in the staging area and stores
that snapshot permanently to your Git

You might also like