Topic

Git repositories

A Git repository stores the history and metadata used to track a project. A typical local checkout also has a working tree containing editable files.

At a glance

Editable files
Working tree
Next-commit selection
Staging area or index

Overview

A Git repository stores the history and metadata used to track a project. A typical local checkout also has a working tree containing editable files. The staging area lets a developer select which changes will become part of the next commit.

Three useful views

The working tree shows current files, the staging area holds selected changes, and the repository retains recorded commits. Distinguishing them explains why saving a file is not the same as committing it.

Local and remote copies

Cloning creates a local repository from an existing one. Remotes identify other repositories used for exchanging changes; they are locations for synchronization rather than the sole definition of a project's history.

Sources and review

MOOR's explanatory text is supported by the following source links.

  1. Getting a Git repository — Pro Git
  2. Recording changes — Pro Git

Browse MOOR Knowledge