The site now runs on two computers, the laptop and the computer in the store’s back office, and both push to the same repository on GitHub. The first issue, next week’s deals, is waiting for the back office because that’s where the weekly ad arrives. You can add the deli counter’s hours on the laptop after that.
In this lesson, you’ll push work from both computers, one after the other, and find out what happens when the second push reaches a GitHub repository that has changed. You’ll read what Git tells you, see what GitHub has that your laptop doesn’t, and learn why a quick fix you might find online would throw away the back office’s work. Start in the back office, where next week’s deals are ready to go in.
Push the Deals From the Back Office
The issue Add next week’s deals asks for the weekly ad for December 2 to 8 on the deals page. The deals live in src/data/deals.js, so switch to the VS Code window with the generic-grocery-backoffice folder and open that file. Replace its contents with next week’s deals:
src/data/deals.js
// This week's deals. Prices are in cents, and `unit` is "each", "lb" or "dozen".
// A deal week runs from Wednesday to Tuesday, like the printed weekly ad.
export const dealWeek = { start: "2026-12-02", end: "2026-12-08" };
export const deals = [
{ item: "Large brown eggs", unit: "dozen", regular: 549, sale: 499 },
{ item: "Bananas", unit: "lb", regular: 69, sale: 59 },
{ item: "Honeycrisp apples", unit: "lb", regular: 249, sale: 199 },
{ item: "Whole milk, 1 gallon", unit: "each", regular: 469, sale: 399 },
{ item: "Sourdough loaf", unit: "each", regular: 599, sale: 449 },
{ item: "Russet potatoes, 5 lb bag", unit: "each", regular: 499, sale: 349 },
{ item: "Butternut squash", unit: "lb", regular: 149, sale: 99 },
{ item: "Fresh cranberries, 12 oz bag", unit: "each", regular: 349, sale: 249 },
];
Eggs are back to $5.49 regular with a sale price of $4.99, bananas are on sale at 59¢ a pound, and a few Thanksgiving items make room for apples, milk, potatoes, and squash. Save the file, and then ask Git what it sees in the back office’s terminal:
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: src/data/deals.js
no changes added to commit (use "git add" and/or "git commit -a")
The second line says that the back office’s main tracks origin/main. Git set up that link when you cloned, as git push -u did for your laptop’s main. Because this branch already has its upstream, a plain git push knows where to send it.
Before you commit, check what you’re about to publish, as you’ve done with every change so far. Run git diff and read the lines that start with - and +:
$ git diff
diff --git a/src/data/deals.js b/src/data/deals.js
index 29d4782..60cb00e 100644
--- a/src/data/deals.js
+++ b/src/data/deals.js
@@ -1,14 +1,14 @@
// This week's deals. Prices are in cents, and `unit` is "each", "lb" or "dozen".
// A deal week runs from Wednesday to Tuesday, like the printed weekly ad.
-export const dealWeek = { start: "2026-11-25", end: "2026-12-01" };
+export const dealWeek = { start: "2026-12-02", end: "2026-12-08" };
export const deals = [
- { item: "Large brown eggs", unit: "dozen", regular: 499, sale: 499 },
- { item: "Bananas", unit: "lb", regular: 69, sale: 49 },
- { item: "Ground beef, 85% lean", unit: "lb", regular: 699, sale: 549 },
+ { item: "Large brown eggs", unit: "dozen", regular: 549, sale: 499 },
+ { item: "Bananas", unit: "lb", regular: 69, sale: 59 },
+ { item: "Honeycrisp apples", unit: "lb", regular: 249, sale: 199 },
+ { item: "Whole milk, 1 gallon", unit: "each", regular: 469, sale: 399 },
{ item: "Sourdough loaf", unit: "each", regular: 599, sale: 449 },
- { item: "Fresh apple cider, 1 gallon", unit: "each", regular: 799, sale: 599 },
- { item: "Sweet potatoes", unit: "lb", regular: 149, sale: 99 },
- { item: "Canned pumpkin, 15 oz", unit: "each", regular: 249, sale: 179 },
+ { item: "Russet potatoes, 5 lb bag", unit: "each", regular: 499, sale: 349 },
+ { item: "Butternut squash", unit: "lb", regular: 149, sale: 99 },
{ item: "Fresh cranberries, 12 oz bag", unit: "each", regular: 349, sale: 249 },
];
You replaced the whole file, so the diff is your check that only the deal week and the changed rows differ. The lines shown with a space instead of a - or + prefix, like the comments and the sourdough, are untouched. Press Q if the diff ends in (END).
Then look at the page itself. Run npm run dev, open the Local address in VS Code’s integrated browser, and click Weekly deals. The page should say Deals for Wednesday, December 2 through Tuesday, December 8. and list the eggs at $4.99/dozen and the bananas at 59¢/lb. Press Ctrl+C to stop the server.
Now stage the file and commit it. On GitHub, open the issue Add next week’s deals and note its number, which appears after the title. Replace <number> in the command with that number:
$ git add src/data/deals.js
$ git commit -m "Add the deals for the week of December 2" -m "Closes #<number>"
[main 9397289] Add the deals for the week of December 2
1 file changed, 7 insertions(+), 7 deletions(-)
A second -m adds a second paragraph to the message, below the subject line, and that’s where Closes # and the issue’s number go. Your hash will differ because it depends on your name and the time you commit. Now send the commit to GitHub: