Git has a three-stage architecture, consisting of the working directory, the staging area, and the repository.

Working Directory

The working directory is basically an area, where developers make changes to their code. When a developer modifies or adds or removes a file, the changes are made in the working directory.

Staging Area

Staging Area is used to prepare changes before they are committed to the repository. Developers can selectively choose which changes they want to include in the next commit by adding them to the staging area. If developers want certain files not to go for the commit, then don't add those files to the staging area.

Repository

The repository is where Git stores the history of changes made to the codebase. It contains all versions of the codebase, including the current version and all previous versions. When a developer makes a commit, Git takes the changes from the staging area and creates a snapshot of the project, which is then stored in the repository.