Project: Thanksgiving Week on Two Computers

Your practice clone has done its job, and everything you tried there worked out in the end. Your real repository still has three open issues, though: two that change the Thanksgiving hours and one for the bananas. Customers check the holiday hours before they come in, so the hours had better be right.

In this project, you’ll finish the week in your own repository, using GitHub’s web editor and your laptop, without a walkthrough. You’ll handle a rejected push and a conflict on your own, undo a pushed mistake by its hash, and end with a check report that shows all five issues closed. Start with the brief, so you know what finished looks like before you change anything.

Read the Week’s Brief

A brief describes the finished work before you start, so you can tell for yourself when you’re done instead of waiting for someone to tell you. These are the three issues still open on your repository:

  • Close at 1 p.m. on Thanksgiving
  • Open at 8 a.m. on Thanksgiving
  • Mark bananas down to 49¢ a pound

The week is done when all of these are true:

  • The home page lists Thanksgiving, Thursday, November 26: 8 a.m. to 1 p.m. under Holiday hours.

  • The deals page shows the bananas at 49¢/lb and the eggs still at $4.99/dozen.

  • GitHub’s main is the same commit as your laptop’s, and all five of the week’s issues are closed.

  • Every commit you pushed is still in the history, mistakes included, because you never force a push.

  • npm run check ends with All checks passed.

The work happens in two places. GitHub’s web editor stands in for quick fixes made from your phone, and your laptop’s generic-grocery folder is where you do everything else. The back office doesn’t take part until the very end.

Each change is given exactly, with the file, the line before and after, and the commit message, so your history ends up with the same shape as the one in this course. The Git commands between the changes are up to you. Your hashes and issue numbers differ from the ones shown here, so wherever a message needs Closes #, use your own issue’s number.

Each part has a box of hints that points back to the lesson where you did it before. Try each part on your own first, and open the hints when you’re stuck. You’ll probably get stuck somewhere, and that’s expected. When you do, read Git’s messages carefully, because they get you unstuck more often than you’d expect. Like errors in JavaScript, they’re information about what went wrong, not damage.

Two things get reviewed at the end. One is the report from npm run check, which you save once the week is done. The other is how you resolved the Thanksgiving conflict, which you’ll explain to the mentor afterward, so keep a few notes as you go.

Fix Thanksgiving From Two Places

Two of the issues call for changes to the same day’s hours, and you’ll make those changes from two places that don’t know about each other. That’s what happens when someone fixes a line from their phone while a laptop still has an older copy of the project.

Close Early From GitHub’s Web Editor

You can edit a file on GitHub and commit the change straight from the browser, which is handy when you’re away from your desk. You’ll use it from your laptop’s browser here, and it works the same on a phone. Open the file in GitHub’s editor like this:

  1. Open your generic-grocery repository on GitHub, and click your way to src/data/holidays.js.

  2. Click the pencil icon, Edit this file, above the file’s contents.

In the editor, find Thanksgiving’s line, which still has the store’s old hours:

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.