Lesson 01 of 10Concept

What is Git?

Goal: Understand what Git is, and why almost every software project uses it.

A history for your project

Git is a version control system. It records snapshots of a project over time, so you can see what changed, when it changed and why, and go back when something breaks.

Every save point in Git is called a commit. A commit is a snapshot of every tracked file, plus a short message, an author and a timestamp.

Before and after Git

Without Git

  • report-final.docx, report-final-v2.docx, report-REALLY-final.docx
  • No record of what changed between copies, or why
  • Sharing work means emailing files and merging edits by hand
  • A bad change can overwrite the only good copy

With Git

  • One folder, with a complete history inside it
  • Every commit explains what changed and why
  • Teammates work in parallel and combine their work safely
  • Any earlier snapshot can be restored

History is a chain of commits

Each dot is a commit. Every commit remembers its parent, the commit before it, so together they form the project's history. main points to the newest one.

Git lives on your computer

Git runs locally. The whole history is stored in a hidden .git folder inside your project, so you can commit, browse history and experiment without an internet connection or an account anywhere.

A folder that Git tracks is called a repository, or repo for short.

What you will learn in this course

  • How to turn a folder into a repository with git init
  • How to read git status
  • The three places your changes live: the working tree, the staging area and the repository
  • How to stage changes with git add and record them with git commit
  • How to read your history with git log

Finished reading?

Marking it complete records your progress and XP for this lesson.