AI Hints
Home›Git & GitHub Tutorial›Project: Portfolio
Git & GitHub · Lesson 118 of 144

Project: A Portfolio Site

Solo, start to finish.

⏱ 2 min read▶ Video at 2:09:11🎓 Free
Watch this lesson in the Git & GitHub courseWatch on YouTube ↗Full Git & GitHub course

Time for a real project, using everything so far. We'll build a small portfolio site from nothing, put it on GitHub, add a feature on a branch, and tag a release. Follow along on your own computer.

Project: A Portfolio Site
From the video: Project: A Portfolio Site
  • A portfolio site, from nothing
  • On GitHub, with a branch and a release
  • Follow along

Start the project

We make a folder called portfolio, and git init. We create a home page, and a dot git ignore file for junk files. Status shows both are untracked. We add them, and make our first commit.

git
mkdir portfolio
cd portfolio
git init
Initialized empty Git repository in /Users/sam/projects/portfolio/.git/
echo '<h1>Sam Lee</h1>' > index.html
printf '%s\n' '.DS_Store' '*.log' > .gitignore
git status --short
?? .gitignore
?? index.html
git add .
git commit -m "Start portfolio"
[main (root-commit) 2c14de1] Start portfolio
 2 files changed, 3 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 index.html

Put it on GitHub

On GitHub, we created an empty repository called portfolio. Back in the terminal, we connect it as origin, and push with dash u. Our project is now backed up online.

git
git remote add origin https://github.com/sam/portfolio.git
git push -u origin main
To https://github.com/sam/portfolio.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.

Summary

We started a repository, ignored junk files, made the first commit, and pushed to GitHub. Next, adding a feature on a branch.

Key takeaways
  • git init, .gitignore
  • First commit
  • remote add, push -u
Next up: Project: A Projects Page — a feature branch and a pull request