Skip to main content

Create Your Repository & Clone It

Now that all your tools are installed, it's time to create a home for your project code. We'll create a repository (repo) on GitHub, then clone it to your computer so you have a local copy to work in.

What is a repository?

A repository is just a folder that Git tracks. It lives in two places:

  • Remote — on GitHub's servers (so your code is backed up and shareable)
  • Local — on your computer (where you actually write and run code)

When you make changes locally, you "push" them to the remote. This keeps both copies in sync.

Step 1: Create a new repository on GitHub

  1. Go to github.com and log in
  2. Click the + icon in the top-right corner, then select New repository
  3. Fill in the details:
    • Repository name: Pick a name for your project (e.g., my-site, my-portfolio, my-app)
    • Description: A short description of what you're building (optional)
    • Visibility: Select Public (so you can share it on your resume) or Private if you prefer
    • Initialize this repository with: Check the box for Add a README file
  4. Click Create repository
Why add a README?

Initializing with a README makes the repo non-empty, which makes cloning simpler. The README is also the first thing people see when they visit your repo — we'll update it later.

Step 2: Create a repos folder on your computer

Before cloning, let's create a dedicated folder to keep all your coding projects organized.

Open Terminal and run:

mkdir -p ~/repos
cd ~/repos

This creates a repos folder in your home directory and moves you into it. All your projects will live here.

Step 3: Clone the repository

Now we'll download your GitHub repo to your computer.

  1. Go to your new repository on GitHub (it will be at github.com/YOUR_USERNAME/your-repo-name)
  2. Click the green Code button
  3. Make sure HTTPS is selected
  4. Click the clipboard icon to copy the URL

Back in your terminal (make sure you're in ~/repos), run:

git clone https://github.com/YOUR_USERNAME/your-repo-name.git

Replace YOUR_USERNAME with your actual GitHub username and your-repo-name with whatever you named your repo.

You should see output like:

Cloning into 'your-repo-name'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.

Step 4: Navigate into your project

cd your-repo-name

You're now inside your project folder. This is where all your code will live.

Step 5: Verify everything is connected

Run:

git status

You should see:

On branch main
nothing to commit, working tree clean

This confirms your local repo is connected to GitHub and ready to go.

What just happened?

Here's a recap:

  1. You created an empty project on GitHub (the remote repo)
  2. You created a repos folder on your computer to stay organized
  3. You cloned the remote repo, which created a local copy in ~/repos/your-repo-name
  4. Git is now tracking this folder and knows how to sync it with GitHub

What's next?

Your project is set up and ready for code.