Overview
GitHub Pages turns a repository into a live website, for free, straight from your Git history. In this project you will build a small portfolio page, publish it at https://your-username.github.io, and then update it the professional way — on a branch, through a pull request — watching the live site change after the merge.
You will finish with something genuinely useful: a public portfolio you can put on your CV, built and maintained with exactly the workflow employers use.
- A small, responsive portfolio page (index.html and style.css) with a README.
- A GitHub repository named your-username.github.io, which GitHub publishes automatically.
- An update delivered through a feature branch and a merged pull request.
Prerequisites
- Git installed and configured — lesson 2.
- A free GitHub account, with HTTPS or SSH authentication set up — lessons 10 and 11.
- The everyday commands: add, commit, push and pull — lessons 3 and 10.
- Branches and pull requests — lessons 7 and 12.
The examples use the username priya-sharma. Replace it with your own GitHub username everywhere — the repository name must match your username exactly for GitHub to publish it at your-username.github.io.
Step 1: Create the Website
Create a folder named after your future site and turn it into a repository:
mkdir priya-sharma.github.iocd priya-sharma.github.iogit initClick Run to see what this code prints.
Add three files. Change the text to describe yourself:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Priya Sharma | Web Developer</title> <link rel="stylesheet" href="style.css"></head><body> <header> <h1>Priya Sharma</h1> <p>Aspiring web developer. I build small, fast, accessible websites.</p> </header> <main> <h2>About me</h2> <p>I'm learning HTML, CSS, JavaScript and Git, one project at a time.</p> </main> <footer> <a href="https://github.com/priya-sharma">GitHub</a> </footer></body></html>body { font-family: system-ui, sans-serif; max-width: 720px; margin: 40px auto; padding: 0 16px; line-height: 1.6;}
header h1 { margin-bottom: 0;}# priya-sharma.github.io
My personal portfolio, published with GitHub Pages.Step 2: Commit It
git status --shortClick Run to see what this code prints.
git add .git commit -m "Create portfolio home page"Click Run to see what this code prints.
Step 3: Create the GitHub Repository
- On GitHub, click + → New repository.
- Name it exactly your-username.github.io (for example priya-sharma.github.io).
- Choose Public — GitHub Pages on the free plan publishes from public repositories.
- Leave README, .gitignore and licence unticked, because your local repository already has a commit.
- Click Create repository.
Step 4: Push and Publish
git remote add origin https://github.com/priya-sharma/priya-sharma.github.io.gitgit push -u origin mainClick Run to see what this code prints.
For a repository named your-username.github.io, GitHub publishes the main branch automatically. Open the repository’s Settings → Pages to confirm the source is “Deploy from a branch” with main and the / (root) folder. After a minute or two, your site is live at https://priya-sharma.github.io — the Actions tab shows the deployment while it runs.
Step 5: Update Through a Pull Request
Now add a Projects section the way a team would — on a branch:
git switch -c add-projects-sectionClick Run to see what this code prints.
Add this inside <main>, after the About section:
<h2>Projects</h2> <ul> <li><a href="https://github.com/priya-sharma/weather-dashboard">Weather dashboard</a></li> <li><a href="https://github.com/priya-sharma/recipe-finder">Recipe finder</a></li> </ul>git diff --statgit commit -am "Add projects section"git push -u origin add-projects-sectionClick Run to see what this code prints.
On GitHub, click “Compare & pull request”, check that the base is main, describe the change and create the pull request. Review your own Files changed tab, then click “Merge pull request” and “Delete branch”. GitHub redeploys the site automatically — refresh it after a minute to see the new section.
Step 6: Sync and Clean Up
git switch maingit pullClick Run to see what this code prints.
git branch -d add-projects-sectiongit fetch --prunegit log --oneline --graphClick Run to see what this code prints.
The graph tells the whole story: the first commit, the feature branch and the merge commit GitHub created when you merged the pull request.
Extend This Project
- Add a projects page per project, with screenshots and links to each repository.
- Connect a custom domain under Settings → Pages (you will need to add DNS records with your domain provider).
- Add a dark mode with a prefers-color-scheme media query, delivered through another pull request.
- Create a special repository named exactly like your username (priya-sharma/priya-sharma) with a README.md — GitHub shows it on your profile page.
Summary
You created a repository, published it as a live website with GitHub Pages, and shipped an update through a branch and a pull request. From now on, every change to your portfolio can follow the same safe, reviewable path.