Back to blog

2026-06-29

How To Create A GitHub Repository For Your Portfolio

GitHub is where your portfolio code can live publicly. Once the project is on GitHub, platforms like Vercel can automatically deploy it whenever you push changes.

Step 1: Create A Local Project

  • Build or scaffold your portfolio locally.
  • Make sure the project runs on your machine.
  • Confirm that important files like package.json, app, components, content, and public are present.

Step 2: Initialize Git

Open a terminal in the project folder and run:

Command
git init

Then check the status:

Command
git status

Step 3: Add A Gitignore File

Create a .gitignore file so generated files are not committed.

Common entries:

Command
node_modules
.next
.pnpm-store
.env
.env.local
.DS_Store

Step 4: Stage The Files

Run:

Command
git add .

This prepares the files for the first commit.

Step 5: Create The First Commit

Run:

Command
git commit -m "Initial portfolio website"

This creates a snapshot of the project.

Step 6: Create A GitHub Repository

  • Go to GitHub.
  • Click New repository.
  • Choose a name such as Personal-Portfolio.
  • Keep it empty if your local project already has files.
  • Do not add a README from GitHub if your project already has one locally.

Step 7: Add The Remote Repository

Copy the repository URL from GitHub.

For HTTPS:

Command
git remote add origin https://github.com/your-username/Personal-Portfolio.git

For SSH:

Command
git remote add origin git@github.com:your-username/Personal-Portfolio.git

Step 8: Push To GitHub

Run:

Command
git push -u origin main

If your branch is named master, either push master or rename it to main.

Step 9: Confirm On GitHub

  • Open the repository in GitHub.
  • Confirm the files are visible.
  • Confirm the latest commit appears.
  • Check that the README displays correctly.

Step 10: Use It For Deployment

Once the repository is on GitHub, connect it to Vercel. After that, every push to the production branch can trigger a new deployment.