Sikau

Git & GitHub · Day 6 · about 30 min

Project: A tidy first repository

Everything from this unit, start to finish.

A real project, from zero

Set up a small café website the way a professional would: a repository, ignore rules, and a history that tells its story in clear steps.

Set up like a professional

A tidy first repository is a small thing that signals care to every teammate who opens it.

The very first commits of a repository set its tone. Professionals usually start with the ignore rules and a small README before any real code, so secrets and junk can never slip in, and anyone opening the project knows what it is. Then the history grows in small, clearly named steps that read like a story of how the project was built.

git init
echo ".env" > .gitignore
echo "<h1>Himalayan Café</h1>" > index.html
git add .gitignore index.html
git commit -m "Add home page and ignore rules"
echo "<h1>Menu</h1>" > menu.html
git add menu.html
git commit -m "Add menu page"
git log --oneline

Run git status between every step. It's the habit that keeps beginners — and experts — out of trouble: you always know what's staged, what isn't, and what Git is ignoring.

The rest of this lesson

  • Check your workexplain
  • First repositoryorder
  • Check with…match
  • Ignored secretpredict
  • Build the historychallenge
  • Badge quizquiz
  • Unit 1 complete!recap

Continue this lesson free — run real code in your browser

Continue with Google

See all 18 lessons of Git & GitHub