Commits are the backbone of Git’s change-tracking system. Each commit acts like a snapshot of your project at a specific point in time, recording what changed, who made the change, and why. This allows Git to maintain a complete history of the project, making collaboration and rollback possible.
The .git folder is the hidden directory that makes a project a Git repository. It stores all the metadata, commit history, branches, and configuration data Git needs to track and manage your project. Without it, your folder is just a regular directory with files.
To create a new Git repository in an existing project directory, you initialize Git inside that folder. This sets up the hidden .git directory, which stores all version control information.
git init
Local repository → Where you write and commit code
Remote repository → Where you share and back up code
A Git repository is a special type of project folder that contains not only your files but also a hidden .git directory where Git stores the entire history of changes, branches, and metadata. This makes it fundamentally different from a regular folder, which only holds the current version of files without any version tracking.