Sobes.tech
Intern

What is a commit in Git?

sobes.tech AI

Answer from AI

A commit in Git is a snapshot of the state of your repository at a specific point in time.

It contains:

  • A reference to the previous commit(s).
  • A snapshot of all files and directories in your project (the tree).
  • Metadata:
    • Author and their email.
    • Date and time of creation.
    • Commit message describing the changes.

Each commit has a unique identifier (SHA-1 hash), which allows referencing it and tracking the change history.

Commits are the building blocks of your project's history in Git.