1
2
3
4
5
6
7

Step 3 of 7 , Unit 11

Create a Repository

A repository (developers call it a "repo") is where your project lives on GitHub. Think of it as a project folder in the cloud. Every file you upload, your HTML, your CSS, your images, will live inside this repository. Creating one takes about two minutes.

1

Find the new repository button

From your GitHub dashboard, look for a "+" icon in the top-right corner of the page, next to your profile photo. Click it. A small dropdown menu will appear. Click "New repository".

You can also find a green "New" button on the left side of your dashboard if you are on the repositories tab.

github.com/new

You will see a form titled "Create a new repository." It has fields for the repository name, an optional description, visibility settings (Public or Private), and a checkbox to add a README file. This is where you set up your project folder.

2

Name your repository

The name you give your repository determines your site's URL. There is one special naming rule for GitHub Pages that gives you the cleanest URL possible.

Also works
any-project-name
Any other name creates a Project Site. Your URL becomes yourusername.github.io/any-project-name. Fine for individual projects, but less clean for a main portfolio.
The special rule

GitHub has one special repository per account: if you name it yourusername.github.io (exactly your username, followed by .github.io), GitHub treats it as your main user site and publishes it at that URL automatically once you enable Pages.

For example: if your username is mia-thunderbird, name the repo mia-thunderbird.github.io. Your site will be at mia-thunderbird.github.io.

3

Set visibility to Public

Below the repository name you will see two options: Public and Private. Select Public.

GitHub Pages only works with public repositories on the free plan. A public repository means anyone can view your code, which is also normal and expected in web development. Your HTML and CSS is not a secret.

4

Check "Add a README file"

At the bottom of the form you will see an option to "Initialize this repository with a README." Check that box.

A README is a text file that appears on your repository's main page. It tells visitors what the project is. More practically, checking this box creates the repository with a file already in it, which makes the next step (uploading your files) easier.

5

Click "Create repository"

Leave the other settings (Add .gitignore, Choose a license) at their defaults for now. Scroll down and click the green "Create repository" button.

github.com/yourusername/yourusername.github.io

After creating the repository, GitHub takes you to its main page. You will see one file listed: README.md. Below the file list you may see the README content displayed.

This is your repository, your project folder in the cloud. Right now it is empty except for the README. In Step 4 you will upload all your HTML and CSS files here.

Repository created

Your repository exists. Your project folder is ready and waiting. In Step 4 you will upload your website files into it. That is the most important step in the process, everything up to this point has been setup. Step 4 is where your actual work goes into the cloud.

Do not navigate away yet

Leave the repository page open in your browser. In Step 4 you will come back here to upload your files. If you close it, just go back to github.com, sign in, and find your repository, it will be listed on your dashboard.

← Step 2 Step 4: Upload Your Files →