brewly — Ch.7 · Two folders at once
Exercise 6 of 6
Before you start
Worktrees
A worktree is a second folder for the same repository, with its own files and its own branch. Commits and branches are shared, so nothing needs copying.
One branch can be checked out in only one folder. cd moves you between the folders; the buttons above the files do the same.
Make sure you are in the new folder before you press "Write the code".
- git worktree add ../<folder> <branch>
- create a folder with that branch
- cd ../<folder>
- go into it
- git worktree list
- show every folder
- git commit -am "What you did"
- commit the fix
- git push
- ship it
- git worktree remove ../<folder>
- delete a folder you are done with
You can reopen this any time with “Lesson”.
export function renderCart(cart) {const total = cart.reduce((sum, item) => sum + item.price, 0)document.querySelector('#total').textContent = total.toFixed(2)}
Graph
- 1354d06 Add menu pageHEAD → feature/loyaltyorigin/mainmain
- 619eb3b Style the order button
- 5fc44ac Initial commit