Writing Good Commits & Recipe Project

CSCI 4513 - Web Programming | Week 4, Class 7

Name: _________________________________ Date: _____________

📋 Today's Agenda: Writing Good Commit Messages (20 min) + Recipe Project Work Session (25 min)
🚨 Important: Recipe Project due tomorrow (Thursday) evening!

📝 Part 1: Writing Good Commits

Why Commit Messages Matter

List three reasons why good commit messages are important:

  1. _________________________________________
  2. _________________________________________
  3. _________________________________________
💡 Career Tip: Employers WILL look at your _________________ history on GitHub!

Anatomy of a Good Commit Message

A good commit message has two parts:

  1. Subject Line: Describes _________________ you did
    Character limit: _____ to _____ characters
  2. Body (optional): Explains _________________ you did it and _________________ it solves the problem
⚠️ Remember: Always leave a _________________ line between subject and body!

Bad vs. Good Commits

❌ Bad Example:
fix bug

Problems with this commit:

  • _________________________
  • _________________________
✅ Good Example:
Fix navbar collapse on mobile devices

The hamburger menu wasn't toggling due to
missing data-toggle attribute.

Why this is better:

  • _________________________
  • _________________________

The 7 Rules of Great Commit Messages

  1. Separate subject from body with a _________________
  2. Limit subject line to _____ characters
  3. _________________ the subject line
  4. Don't end subject line with a _________________
  5. Use _________________ mood (e.g., "Add" not "Added")
  6. Wrap body at _____ characters
  7. Use body to explain _________________ and _________________, not how

When to Commit

You should commit when you (check all that apply):

Creating Multi-line Commits

To create a commit with subject and body:

# Instead of: git commit -m "message" # Use: git _________ # This opens _________ where you can write multi-line messages

✍️ Practice: Fix These Commits

Rewrite these bad commit messages to be more descriptive:

Bad Commit Your Improved Version
"css changes" _________________________________________
"oops" _________________________________________
"FINALLY!!!!" _________________________________________
"stuff" _________________________________________

🍳 Part 2: Recipe Project Requirements

Project Structure

Your project needs:

Each Recipe Page Must Include

Check off as you complete each requirement:

File Structure

Draw or write your project's file structure:

odin-recipes/ ├── _________.html ├── recipes/ │ ├── _________.html │ ├── _________.html │ └── _________.html └── _________/ ├── (your image files)

HTML Template - Index Page

Fill in the missing parts:

<!DOCTYPE html> <html lang="_____"> <head> <meta charset="_________"> <_________>Odin Recipes</_________> </head> <body> <h1>Odin Recipes</h1> <_____> <!-- Start list --> <li><a href="_________________">Recipe Name</a></li> </_____> <!-- End list --> </body> </html>

HTML Template - Recipe Page

Complete the image tag with proper attributes:

<img _________="../images/lasagna.jpg" _________="Delicious lasagna">

Write the link tag to go back to the main page:

<___ _________="../index.html">Back to recipes</___>

🔄 Git Workflow for Your Project

Suggested Commit Messages

Write appropriate commit messages for these milestones:

  1. Creating initial project structure:
    _________________________________________
  2. Adding the main index page:
    _________________________________________
  3. Adding your first recipe:
    _________________________________________
  4. Adding images to recipes:
    _________________________________________
  5. Fixing a broken link:
    _________________________________________

Git Commands Sequence

Number these commands in the correct order (1-5):

🔧 Common Issues & Solutions

Problem Possible Cause Solution
Images not showing _________________ path is wrong Check ../ for going up directories
Links not working Missing _________________ extension Include .html in href
Page looks weird Missing closing _________________ Check all tags are closed properly
⚠️ Testing Reminder: Click _________________ link and verify _________________ image before submitting!

✅ Final Submission Checklist

Before submitting on D2L, ensure you have:

GitHub Repository URL:

https://github.com/_________________/odin-recipes

📝 Additional Notes

Use this space for any additional notes, questions, or reminders:










🎯 Key Takeaways

The three most important things I learned today:

  1. _________________________________________
  2. _________________________________________
  3. _________________________________________

One thing I want to practice more:

_________________________________________