Back to Learning Path

Step 4: Your First Repository

A repository (or "repo") is simply a folder that Git is watching. Let's create your very first one!


Create a Repo Step by Step

1. Create a new folder

Open your terminal and create a project folder:

bash
mkdir my-first-repo
cd my-first-repo

2. Initialize Git

Turn this folder into a Git repository:

bash
git init

You should see: Initialized empty Git repository

3. Check the status

See what Git knows about your folder:

bash
git status

This shows you're on the main branch with no commits yet. That's expected — we haven't saved anything yet!


What Just Happened?

When you ran git init, Git created a hidden .git folder inside your project. This folder stores all the history and tracking information. You never need to touch this folder directly — Git manages it for you.

Try It Yourself

Create a file in your new repo and check the status again:

bash
echo "Hello, Git!" > hello.txt
git status

You should see hello.txt listed as an "untracked file". Git sees the file but isn't tracking it yet — we'll fix that in the next lesson!

Common Mistakes

  • Running git init in the wrong folder — Always make sure you're inside the project folder before running git init.
  • Initializing in your home directory — Don't run git init in your Desktop or home folder. Always create a dedicated project folder first.

Quick Summary

  • A repository is a folder tracked by Git
  • Use git init to create a new repo
  • Use git status to see what's happening