Skip to content

Why We Need Git

  • Section: Git and GitHub
  • Lesson: 1
  • Duration: 8m 20s
  • What version control means
  • Problems with manual file copies
  • Tracking changes
  • Collaboration between developers

Before Git, developers often managed different versions of a project by manually copying files and creating folders with names such as:

  • project-final
  • project-final-v2
  • project-final-fixed
  • project-final-really-fixed

This approach quickly becomes confusing and unreliable, especially when several developers are working on the same project.

Git exists to replace this chaos with a tracked, organized, and reversible history of changes.

Git helps developers track every change, protect their work, collaborate safely, and return to an earlier version whenever necessary.

The Solution: A Version Control System (VCS)

Section titled “The Solution: A Version Control System (VCS)”

A Version Control System, commonly abbreviated as VCS, is a tool used in software development and collaborative projects to track and manage changes made to source code.

Instead of creating separate manual copies such as V1, V2, and V3, a version control system stores the project’s changes in an organized history.

A Version Control System allows developers to:

  • Track changes made to the source code.
  • Keep a history of different project versions.
  • Identify who made each change.
  • Understand when and why a change was made.
  • Return to an earlier version when necessary.
  • Collaborate without overwriting each other’s work.

“Distributed” means that every developer has a complete copy of the repository on their own computer, including the project files and the full history of changes.

This allows developers to work locally, create commits, and review previous changes without needing a permanent connection to a central server.

Git commits are similar to checkpoints in a video game.

In a game, you save your progress at different checkpoints. You can continue playing, and if something goes wrong, you can return to the last saved checkpoint instead of restarting the entire game.

Git applies the same idea to source code. Each commit acts as a save point that records the project at a specific moment.

  1. Start

    Empty project

    The project has just been created.

  2. Checkpoint

    Login works

    The login feature is complete and saved in a commit.

  3. Checkpoint

    Dark theme added

    The dark theme is complete and saved in another commit.

  4. You Are Here Now

    Still coding

    The developer is currently working on new changes.

If the current changes cause a problem, the developer can return to checkpoint 2 or checkpoint 3 without losing the earlier, working versions of the project.

A commit is a saved snapshot of the project at a specific point in time.

Each commit contains the changes that were recorded at that moment, along with a message explaining what was changed.

Commits allow developers to:

  • Save meaningful stages of their work.
  • Review previously recorded changes.
  • Compare different versions of the project.
  • Return to an earlier stable version.
  • Understand how the project developed over time.

A commit is not the same as saving a file with Ctrl + S.

Ctrl + S saves the current file on your computer, while a Git commit records a meaningful version of the project in Git’s history.