Making Commits and Publishing Changes

How to save and publish your changes to the live site.


Overview

"Making a commit" means saving a snapshot of your changes and publishing them to the website. You can do this entirely in your web browser or using command-line tools.


Method 1: GitHub Web Editor (Recommended for Beginners)

You can commit changes directly on GitHub.com without any software installation.

Step 1: Make Your Changes

Edit files directly on GitHub.com using the web editor:

See GitHub Web Editor Guide for detailed instructions.

Step 2: Write a Commit Message

When you save a file, GitHub prompts you to describe your changes.

Good messages:

Bad messages:

Tip: Be specific about what you changed and why. Future you will appreciate it!

Step 3: Choose Where to Commit

GitHub gives you two options:

Option A: Commit directly to the main branch

○ Commit directly to the main branch

Option B: Create a new branch for this commit and start a pull request (Recommended)

● Create a new branch for this commit and start a pull request

We strongly recommend Option B for all content changes.

Step 4: Create a Pull Request (If Using Option B)

After choosing "Create a new branch," GitHub guides you through creating a pull request (PR):

  1. Name your branch (optional)

  2. Create the PR

Step 5: Wait for Preview

Netlify automatically builds a preview of your changes (takes 3-5 minutes):

  1. Look for checks at the bottom of your PR
  2. Wait for "netlify/deploy-preview" to show ✅ green checkmark
  3. Click "Details" next to "netlify/deploy-preview"
  4. Your preview site opens in a new tab

If you see ❌ red X instead:

Step 6: Test on Preview

  1. Navigate to your new content on the preview site

  2. Check that everything looks correct:

  3. If you find issues:

Step 7: Merge When Ready

Once everything looks good:

  1. Go back to your PR on GitHub
  2. Click "Merge pull request" (green button)
  3. Click "Confirm merge"
  4. Optionally delete the branch (GitHub prompts you)

Your changes go live in 3-5 minutes!


Method 2: Command Line (Advanced Users)

If you have git and a code editor installed locally, you can use command-line tools.

The Workflow

1. Make Your Changes

Edit files locally in your code editor (VS Code, etc.).

2. Check What Changed

git status

Shows which files you've modified.

3. Stage Your Changes

git add .

Selects all changes to include in the commit.

Or stage specific files:

git add entries/projects/casa-marianella/

4. Create a Commit

git commit -m "Add Casa Marianella project"

Saves a snapshot with a message describing what you did.

5. Push to GitHub

git push

Uploads your changes to GitHub.

If this is a new branch:

git push -u origin branch-name

6. Create Pull Request

If you pushed to a branch (not main):

  1. Go to GitHub.com
  2. Click "Compare & pull request"
  3. Add description
  4. Click "Create pull request"

7. Wait for Deploy

Netlify automatically rebuilds the site (3-5 minutes).

Using VS Code's Git UI

VS Code has a visual git interface if you prefer not to use commands:

  1. Click the Source Control icon (sidebar, third icon)
  2. Review changed files in the list
  3. Click "+" next to files to stage them
  4. Type commit message in the text box
  5. Click checkmark ✓ to commit
  6. Click "..." → "Push" to upload to GitHub

Comparing the Two Methods

FeatureWeb EditorCommand Line
InstallationNone requiredRequires git + code editor
SpeedSlower (page reloads)Faster (local editing)
PreviewNetlify preview (3-5 min)Local dev server (instant)
Best forSimple edits, beginnersComplex changes, batch edits
Works offlineNoYes
Learning curveEasyModerate

For most content editing, the web editor is perfectly fine!


Pull Request Best Practices

When to Create a PR

Always use PRs for:

Direct to main is okay for:

Making Changes to an Existing PR

If you need to update your PR after creating it:

Web Editor:

  1. Switch to your branch using the branch dropdown (top left)
  2. Make your edits
  3. Commit to the same branch
  4. PR updates automatically

Command Line:

git add .
git commit -m "Update project description"
git push

PR updates automatically with new commits.

Multiple People Working Together

If someone else needs to help with your PR:

  1. Share the branch name with them
  2. They can checkout your branch locally:
    git fetch
    git checkout branch-name
    
  3. They make changes and push to the same branch
  4. PR updates with their commits

Common Issues

"Nothing to commit"

Problem: Git says there's nothing to commit.

Solutions:

"Push rejected" or "Updates were rejected"

Problem: Someone else pushed changes before you.

Solution:

git pull    # Download latest changes
git push    # Try pushing again

If you get a merge conflict, see Git for Beginners.

"Build failed" on Netlify

Problem: Netlify can't build your site.

Common causes:

Solution:

  1. Click "Details" on the failed check
  2. Read the error message
  3. Fix the issue
  4. Commit again to the same branch

See Common Issues for more help.

"I committed to the wrong branch"

Problem: You meant to create a new branch but committed to main.

Solutions:

If you haven't pushed yet:

git reset HEAD~1    # Undo the commit (keeps your changes)
git checkout -b new-branch-name
git add .
git commit -m "Your message"
git push -u origin new-branch-name

If you already pushed to main:


Understanding Commits

What is a Commit?

A commit is a snapshot of your work at a specific point in time. Think of it like:

Each commit has:

Commit History

All commits are saved permanently. You can:

This is why good commit messages matter - they help you understand what happened and when.

Commits vs. Saves

You can save many times before making a commit.


Tips for Good Commits

One Logical Change Per Commit

Good:

Bad:

Why? If you need to undo the contact email change later, you don't want to also undo the project.

Commit Often

Don't wait until everything is perfect. Commit frequently:

You can always make more commits!

Write Helpful Messages

Future you (and your teammates) will thank you:

Good:

Bad:

Format: Start with a verb (Add, Fix, Update, Remove)


Next Steps


Quick Reference

Web Editor Workflow

  1. Edit file on GitHub.com
  2. Write commit message
  3. Choose "Create a new branch"
  4. Create pull request
  5. Wait for preview (3-5 min)
  6. Test on preview URL
  7. Merge when ready

Command Line Workflow

git status              # Check what changed
git add .               # Stage all changes
git commit -m "message" # Create commit
git push                # Upload to GitHub

Good Commit Messages