A Git repository is the data structure that stores a project's complete history as a graph of commits, along with the files, branches, tags, and metadata needed to track and manage every change over time.
Running git init in a project folder creates a hidden .git directory that becomes the repository, tracking every subsequent commit, branch, and tag made in that project from that point forward.
git init
git add .
git commit -m "Initial commit"A concise interview answer is
A Git repository is the underlying data structure, stored in the .git directory, that tracks a project's full commit history along with its branches, tags, and metadata. Since every clone contains that complete history, each one is effectively a full backup of the project.
Last updated: 16 July 2026
Previous question: What is the difference between git clone, git pull and git fetch?
Next question: What is a Git commit?