Bring Main's Fixes Into Your Branch

Your vite branch now has a site that runs on Vite’s dev server and builds all four pages. The move isn’t finished, though, because the deals page and curbside pickup are still on the README’s to-do list. Meanwhile, the last two to-dos can’t wait that long. On Christmas Eve, the store closes at 3 p.m., and on New Year’s Day it opens at 10 a.m. The live site still shows the old hours.

In this lesson, you’ll make both fixes on main, the branch you publish the live site from, and then bring them into vite with git merge, so that your branch doesn’t fall behind. You’ll finish by reading the result in Git’s log, drawn as a graph. Start on main.

Fix the Holiday Hours on main

The fixes belong on main because main holds the site the store publishes today. If you made them on vite, they would only be ready to publish once the whole move is done, which could be after Christmas.

A commit only changes your repository. Customers see the new hours once you upload the changed files to the host, the way you’ve published sites before, and that upload isn’t part of this lesson.

So switch to main first. If the dev server or the preview is still running, stop it with Ctrl+C in its terminal, because main doesn’t have Vite. Then run this command:

Language: Shell
$ git switch main
Switched to branch 'main'

Before you change anything, check where the repository stands. main has no package.json yet, so npm run check doesn’t work here.

If you type it out of habit, npm stops with Could not read package.json and a few lines of explanation, and no harm is done. Instead, run the script itself with node scripts/check.js. Its report ends like this, with long lines wrapped for display:

Language: Program Output
...
✔ You're on the main branch.
✔ .gitignore keeps node_modules/ out of the repository.
! .gitignore doesn't list dist/, the build output.
  Next step: the dist/ rule is committed on the vite branch, so leave
  dist/ out of your commits here until vite is merged.
✔ No tracked file holds a Generic Curbside secret key (curb_sec_...).
! The vite branch isn't merged into main yet.
  Next step: finish the move on vite, then git switch main and git merge
  vite.
! Not everything is committed yet: dist/.
  Next step: stage your changes by file name, not with git add ., and
  leave dist/ out of the commit.

All checks passed, with 3 thing(s) worth a look.

The vite warning is expected, because the move isn’t done. The two warnings about dist/ need a closer look. You built the site on vite, and dist/ is a folder on disk that no commit contains, so it came along when you switched, like any untracked file. The rule that ignores it is in the .gitignore you committed on vite, and main still has the older .gitignore.

You might be tempted to add dist/ to .gitignore on main as well. The rule is already written and committed, though, and it reaches main with the rest of the move. Until then, follow the report’s advice: stage by filename and leave dist/ out.

If the folder that’s ignored on one branch and untracked on the other still feels slippery, then the button below opens a chat with the mentor. It fills in the question, and you can describe what you see in your own Explorer:

Now make the first fix. Open src/data/holidays.js and change Christmas Eve’s closing time from "16:00" to "15:00", so that its line reads like this:

Language: JavaScript
  "2026-12-24": { name: "Christmas Eve", open: "07:00", close: "15:00" },

In README.md, tick off the to-do by changing its - [ ] to - [x]. Then check what Git sees:

Language: Shell
$ git status
On branch 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:   README.md
    modified:   src/data/holidays.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    dist/

no changes added to commit (use "git add" and/or "git commit -a")

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.