Git

Introduction

This is a page containing the topics for Git1.

Git is a distributed version control system that tracks changes in your files and manages multiple versions of your project history. At its core, git maintains a repository—a structured storage of your project’s history—with three main areas:

  • Working directory: where you edit files
  • Staging area (index): where you prepare files for the next commit
  • Repository: where your committed changes are permanently stored

The typical workflow involves making changes in your working directory, staging files you want to include in your next commit, and then committing those changes to save a snapshot in the repository’s history.

gitflow Working_Directory Working Directory Staging_Area Staging Area (index) Working_Directory->Staging_Area git add Repository Git Repository (history) Staging_Area->Repository git commit Repository->Working_Directory git checkout

This illustration shows the fundamental flow in git: files move from your working directory to the staging area with git add, and then from staging to the repository with git commit. You can also retrieve files from the repository to your working directory with git checkout.

Footnotes

  1. https://git-scm.com/↩︎