Welcome to Track Your Project With Git

A few years ago, someone built a website for Generic Grocery Co. (your friendly neighborhood grocery store). That programmer has since moved on to growing potatoes on their own farm. At least maybe that’s what they’re doing. Who knows, it’s been impossible to get in contact with them. Anyway, the site is yours to look after now.

It arrived as a ZIP file with a to-do list in its README:

There’s a lot in there! One file even comes in… three different versions?! Is deals-FINAL2.js really the final one, or should you look at deals.js? The names alone don’t tell you which one is live, and the ZIP doesn’t record who changed what, when, or why—Oh my!

In this course, you’ll fix that with Git. You’ll record every change that you make to the store’s site with a message that explains it, so you can always look back and find out what happened. Or whoever will take on this project once you’ve finally made your breakthrough as a daredevil wingsuit jumper.

What You’ll Learn

This is the first of five courses in the Tooling and Git for JavaScript Projects path, where you work on the same store’s site the way a professional team works on a project. Later courses add packages, GitHub, code review, and automatic deployments, and each one builds on the history that you start here. If you’ve come to this course directly, you’re in the right place, because everything you need comes in the ZIP and in the lessons.

This course takes the store’s site from a folder of loose files to a project with a clean history:

  1. Getting Started With Git shows why handmade copies like deals-FINAL2.js can’t answer your questions, then gets the site running and Git installed and set up.

  2. Your First Commits takes you to a small throwaway practice folder, where you see how git add decides what a commit holds and what happens when you ignore a file too late.

  3. Working on the Store’s Site puts the site under version control using Git and keeps a password out of the repository from the start. You commit one change at a time with a message that says why, and you check each change with git diff first. Then you find out from the history when the price of eggs last changed, and you undo mistakes by throwing away an uncommitted edit or fixing your last commit.

  4. Project: A Week of To-Dos hands you the README’s to-do list to work through on your own, with the Thanksgiving hours as a coding exercise and a review of your history with the mentor.

  5. Reviewing What You’ve Learned wraps up with a quiz and a look back at the habits you’ve built.

Almost every software team keeps its projects in Git, and the habits you build here, such as reading your changes before you commit and writing a message a teammate can follow, are the ones a team expects from a new developer. Yes, even if lots of the code gets written by AI. By the end, your repository holds a record of real work on a real-looking project, and you’ll keep adding to it in the rest of the path.

How the Course Works

Most lessons are text-based, and you follow along in your own terminal and editor. There are also some short video lessons, with their key points and code written out below them. Every lesson starts from a problem that you can see in the project.

Along the way, you’ll run into a few of the mistakes that almost everyone makes with Git. That’s expected, and each time, the lesson explains what happened and how to do it differently before you move on.

The store’s site is the starter project linked above, and below here again. Download the ZIP now, if you haven’t yet, and unzip it wherever you keep your projects. You’ll open it in the next lesson:

The project comes with a small check script that you run with node scripts/check.js. It inspects your repository and marks each check with a little symbol:

  • ✔ when it passes
  • ✘ when it fails
  • ! for a warning

It also gives you a next step for every problem that it finds. It can’t look at your pages, though, so you’ll have to check those yourself in VS Code’s integrated browser before you commit.

There are also quizzes that let you test yourself, one after your first commits and one at the end. The project also includes a coding exercise, which runs in your browser with automated tests. The project’s brief explains how the exercise works before you get there. Wherever you see a mentor button, click it to open a conversation with the mentor. You can send the question that’s already filled in or change it first.

What You Should Know Already

This course assumes that you’ve written and run some JavaScript before. In particular, you should be comfortable with the following:

You don’t need any experience with Git, and you don’t need a GitHub account, because everything in this course happens on your own computer. You’ll install Git in the second lesson. If you’ve pasted a Git command from a tutorial before without knowing what it did, that’s completely fine, because this course starts from the very beginning and explains every command when you need it.

If you’re not sure whether you’re ready, the button below opens a conversation with the mentor. It’ll ask you a few short questions about these skills, one at a time, and tells you whether to start here or brush up on something first:

When you’re ready, move on to the next lesson. There, you’ll unzip the store’s site, meet its three deals files, and find out what version control is for.

In the downloads below you can get more code that covers everything you’ll encounter in this course, and slides from the video lessons:

Download

Course Slides (.pdf)

207.1 KB
Download

Sample Code (.zip)

9.4 KB

You can fetch these now, or come back to them later, when you need them.

Become a Member to join the conversation.