
Mini lesson 27 of 30 · Run and maintain your website
Identify the two versions
Who is this for?
People publishing from a repository who want to inspect changes before release. A coding assistant and repository/hosting tools can handle the branch mechanics.
A review needs both a starting point and a proposed change.
Purpose of this lesson
- Create a separate review version.
- Compare preview and current site with the same task.
- Tie approval to the actual reviewed version.
Explanation, worked example and practice
Before you start
Your own separate GitHub repository connected to a Netlify practice project, with pull-request previews enabled. Cloud builds use account credits. The workshop supplies before/change files; use a disposable site rather than a real production change.
Check your starting skills
These are useful skills, not locked course requirements. If you can already do them, start this lesson; otherwise open the linked preparation. The supplied starter files mean you do not need an existing personal website.
- How to publish your website from GitHub
Connect a practice repository to hosting.
Estimated time: 20–32 min
Estimates for the supplied starter files with prerequisite accounts and tools ready. Setup, deployment queues and delivery/DNS waits take additional time. Cloud build waits and account setup are additional. Public previews must not contain private test data or production secrets.
Understand the idea
Use the supplied starter page to establish P1 on your separate practice hosting project. With your assistant, compare it with the supplied change page: P1 says “Find contact information”, while P2 says “Contact me”. Both should reach the same Contact section.
Keep the currently published P1 address as the baseline. The proposed P2 belongs on an unmerged review branch and its separate preview; record their visible version markers so you can tell which page you are testing.
A concrete example
This is a small wording change, not a new contact system. The proposed label should become clearer while the existing contact destination keeps working.
Use the supplied practice-site change. Help create a separate review branch and pull request with a Netlify preview, leaving the current published practice version unchanged. Show both URLs and identify the version under review. Do not merge or publish production without my approval. Help test the changed task and record unresolved issues.Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
Try it yourself
Which change will you review, and how will you recognize the current and proposed versions?
Show a worked solution
I will compare P1’s “Find contact information” with P2’s “Contact me”. Both should reach the Contact section. I will keep P1 as the published baseline and recognize the unmerged preview by its P2 marker; I will record both URLs.
What a sound answer includes
- Identifies the exact contact-label change and what should stay unchanged.
- Distinguishes published P1 from proposed preview P2.
How it works (optional)
Preview a change before publishing it
Give a proposed version its own review URL while production keeps working.
A preview lets you test the actual built result of a branch before merging it into the production source. A local file that looks good may still have wrong build paths or environment settings.
This workshop uses an intentionally small change: P1 says “Find contact information”; P2 says “Contact me”. You will identify both versions and check the same contact task before deciding to merge.
Worked example
While the pull request is unmerged, the preview should show P2 and the normal public site should still show P1. If both changed, investigate which branch deploys to production.
Extra implementation exercise
Why should your review record include both the preview and production version?
Show a worked solution
It establishes that the preview contains the proposed change while the public site retains the approved version. A working preview alone does not prove that separation.
- Proves which version is under review.
- Confirms production was not accidentally changed.

Step 1 · How to preview website changes before publishing
Create a review preview
Let the assistant guide the repository steps.
Explanation, worked example and practice
Understand the idea
Use the dedicated practice repository and enable its pull-request previews in your hosting account. Ask the assistant to create a review branch with the supplied P2 change, push that branch and open an unmerged pull request. These hosted builds can use account credits.
Open the resulting preview and read the visible P2 marker. Save the preview URL together with the exact reviewed commit from the repository or host. A later commit on the same branch is a new version to inspect.
A concrete example
A branch named improve-contact-label can contain several different commits over time. Approval for its first preview does not automatically cover the next commit.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
Try it yourself
What preview did you open, and which version does it contain?
Show a worked solution
An illustrative record identifies the host-generated preview URL, marker P2 and the exact commit copied from the pull request. I would confirm “Contact me” is present there. If I see P1 or cannot find a preview build, that preview has not yet passed this check.
What a sound answer includes
- Pairs the real preview URL with its P2 marker and exact source revision.
- Does not treat a branch name alone as the reviewed version.
How it works (optional)
Open a branch review with a reproducible change
Connect a pull request to a specific source revision.
Follow commands.txt only inside your own disposable repository. Commit the P2 change on a branch and open a pull request without merging it. Netlify's Deploy Preview should link a built URL to that pull request/revision.
Read the deploy details rather than inferring success from the browser. Record the commit and check the publish directory. If no preview exists, inspect project preview settings and build logs; do not compensate by publishing the branch to production.
Before the branch commands, open the existing P1 public URL, click its contact link and record the working P1 commit in review-record.csv. If there is no working P1 deployment, complete that baseline first. For the homework, fill both rows: surface, URL, commit, visible version, contact-task result and any unexpected side effect.
If the production branch changes while you work, inspect the pull request’s update/conflict status before continuing. Fetch the current branch state and resolve any conflict deliberately in your own branch; ask for help if unsure rather than overwriting unrelated work. After resolving, review the new preview revision again.
If the preview URL is missing, check that Deploy Previews are enabled for repository pull requests, the branch is not excluded, the build log passes and netlify.toml points to the intended public directory. In the provider’s Deploys history, open the current production deploy to find its actual source commit.
Worked example
A green commit check and a readable preview should refer to the same revision. Editing the branch afterward creates a new revision that needs its own review.
Extra implementation exercise
You reviewed commit A, then pushed commit B to the same branch. Is B covered by the old approval?
Show a worked solution
No. The branch name stayed the same but the content changed. Check the preview built from B and review the differences.
- Ties review to a specific revision.
- Retests the changed preview before promotion.

Step 2 · How to preview website changes before publishing
Repeat the visitor task safely
A different hostname does not make real services harmless.
Explanation, worked example and practice
Understand the idea
Open published P1 and preview P2 signed out and at a narrow width. In each, activate the contact action and check that the Contact section remains reachable. For this supplied static example, stop at the contact target; do not send mail to the placeholder address.
If you later apply the technique to forms, payments or stored data, inspect the preview’s service settings first. A new preview hostname can still call a real service; use separate test accounts and data for those effects.
A concrete example
For the supplied example, P1 and P2 both reach the Contact section; P2 changes only the visible link label and version marker. Neither version needs to send an email or write a database record.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
Try it yourself
What did the same task do in each version, and which test-service boundaries did you verify?
Show a worked solution
Illustrative comparison: P1’s “Find contact information” and P2’s “Contact me” both reach Contact at a narrow width and while signed out. The supplied change has no mail-sending, payment or database action; I did not trigger the placeholder email address.
What a sound answer includes
- Performs the same contact task in both versions and compares its outcome.
- Checks narrow/signed-out use and separates this static action from real external side effects.
How it works (optional)
Separate preview data and side effects
A different URL does not automatically isolate its backend.
Our static contact-link example has no backend side effects. In a real app, review preview-context variables separately: database, email recipient, payment mode and credentials can still point at production.
Use disposable test data and provider sandboxes where needed. A preview protected from casual viewing can still execute a server function with whatever credentials you configured.
For example, if your function reads SUPABASE_URL, keep that same variable name but configure its Deploy Preview context value to the disposable database project. Do not invent a new variable name the code never reads. Review every secret/recipient/payment mode in that context too; copying the production value defeats isolation.
In the Netlify project dashboard, open the environment-variable settings and edit the variable’s Deploy Preview context value independently of its Production value. Save only a test-service value for that context, trigger a new preview build and verify the resulting revision; changing a dashboard value does not prove an older deployed function picked it up. See the official context guide below.
Worked example
A preview contact form connected to the production mailing provider could send real messages. The words “preview” in its URL do not stop that call.
Netlify: environment variables and deploy contexts · Netlify: deploy-context environment variables
Extra implementation exercise
Is a unique preview hostname enough to guarantee that test purchases cannot charge real money?
Show a worked solution
No. Configure the preview with test credentials and isolated services, then verify their actual behaviour. Hostname separation alone is insufficient.
- Checks payment credentials/mode and data targets.
- Does not confuse frontend URL separation with backend isolation.

Step 3 · How to preview website changes before publishing
Make a version-specific review decision
Approval follows the result you actually inspected.
Explanation, worked example and practice
Understand the idea
Complete review-record.csv with URLs, reviewed version, observations and remaining issues. Ask for any bounded repair and inspect the resulting preview again.
Leave the current site unchanged until an explicit release decision. If the version changes after review, identify what needs retesting.
A concrete example
A useful review is specific: “P2’s revised contact label reaches the same section at 390px and desktop; the published baseline remains P1.” It names the tested revision and does not merge the pull request.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
Try it yourself
Provide the preview and current-page comparison with your approval or remaining issue.
What to produce: The preview/current URLs and an actual comparison record for the reviewed version.
Show a worked solution
Illustrative decision: P2’s “Contact me” label is clearer and reaches the same section as P1 at 390px and desktop. I approve that exact recorded preview revision for a later release decision; the exercise leaves the pull request unmerged and P1 published. Any new commit needs another look.
What a sound answer includes
- Ties the comparison and review decision to the exact preview revision.
- Leaves published P1 unchanged and lists any issue requiring a new preview review.
How it works (optional)
Your assignment: submit a reviewable change
Make the review small and support it with observable results.
Create one additional label or layout improvement on the branch. Check direct opening, mobile width and the contact task on its preview. Compare with the production version.
Provide a short change description with the preview URL, source revision and observations. Only merge after the intended reviewer approves the actual version; this exercise does not require a production promotion.
For the narrow check, use browser developer tools at a 390px viewport and then a desktop width. Record the actual width and contact-task result in review-record.csv; this assignment leaves the branch unmerged.
Worked example
“Changed the contact label; the link still reaches #contact at 390px and desktop width” is more useful than “looks better”.
The complete reference walkthrough is available in reference/assignment-walkthrough.txt. Compare its steps with your own result; fill the test record from observations in your own project.
Extra implementation exercise
Produce a branch preview and completed comparison record without changing production.
Show a worked solution
Confirm P1 already works on the practice public URL and record its commit. On the review branch change the visible marker to P2 and the contact label to 'Contact me', commit/push that branch in your own account and open an unmerged pull request.
Record both rows in review-record.csv: production URL/commit/P1/contact works; preview URL/new commit/P2/contact works. Open both signed out and at a narrow width. The preview's backend settings must point to isolated test services if it has side effects. Repeat those surface checks at 390px and a desktop width; use separate CSV rows and record each actual width.
After another branch commit, recheck that new preview revision. The reference request description shows the information a reviewer needs; keep the branch unmerged and do not promote production as part of this assignment.
- Production remains at its approved revision during review.
- The exact preview revision passes the stated visitor task.
Was this lesson useful?
Leave a like, or share it with someone who could use it.