Creating a Repository
A Git repository ("repo" for short) is just a project folder that Git is keeping history for. You turn any folder into one with a single command.
git init
Navigate to your project folder in the terminal and run:
cd my-project git init
Initialized empty Git repository in /Users/ava/my-project/.git/
That's it — my-project is now a Git repository. Nothing about your existing files changed; Git just started paying attention to the folder.
What the .git folder actually is
git init creates a hidden folder named .git inside your project. This is where all of Git's tracking data actually lives — every commit, every branch, every bit of history. It's easy to forget it's there since it's hidden, but it's worth knowing: if you ever delete .git, you delete the entire history of the project, even though your regular files stay untouched. Everything else Git-related (git status, git log, and so on) is really just reading from and writing to this folder.
git init once per project, right at the start. If you're joining a project that already has a Git history, you'll use git clone instead, covered in Working with Remotes.git status
git status is the command you'll run more than any other — it tells you exactly what Git currently sees: what's changed, what's staged, and what branch you're on. Right after git init, with a couple of files in the folder, it looks like this:
git status
On branch main No commits yet Untracked files: (use "git add <file>..." to include in what will be committed) index.html style.css nothing added to commit but untracked files present (use "git add" to track)
"Untracked" means Git can see these files exist but isn't recording history for them yet. That changes in the next lesson, when you stage and commit them.