📋 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:
- _________________________________________
- _________________________________________
- _________________________________________
💡 Career Tip: Employers WILL look at your _________________ history on GitHub!
Anatomy of a Good Commit Message
A good commit message has two parts:
- Subject Line: Describes _________________ you did
Character limit: _____ to _____ characters
- 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
- Separate subject from body with a _________________
- Limit subject line to _____ characters
- _________________ the subject line
- Don't end subject line with a _________________
- Use _________________ mood (e.g., "Add" not "Added")
- Wrap body at _____ characters
- Use body to explain _________________ and _________________, not how
When to Commit
You should commit when you (check all that apply):
- ☐ Complete a feature (even a small one)
- ☐ Fix a bug
- ☐ Add a new file or component
- ☐ Make a meaningful change that works
- ☐ Before trying something experimental
- ☐ End of a work session (with working code)
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:
- Main _________________ page listing all recipes
- At least _____ separate recipe pages
- Proper file organization (folders for _________________ and _________________)
- Links between _________________ pages
Each Recipe Page Must Include
Check off as you complete each requirement:
- ☐ Recipe title using _____ tag
- ☐ Image of the dish with proper _____ attribute
- ☐ Description in a _____ tag
- ☐ Ingredients using _____ list (unordered)
- ☐ Steps using _____ list (ordered)
- ☐ Link back to _________________
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:
- Creating initial project structure:
_________________________________________
- Adding the main index page:
_________________________________________
- Adding your first recipe:
_________________________________________
- Adding images to recipes:
_________________________________________
- Fixing a broken link:
_________________________________________
Git Commands Sequence
Number these commands in the correct order (1-5):
- ___ git push origin main
- ___ git add .
- ___ Make changes to files
- ___ git commit
- ___ git status (to check what changed)
🔧 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:
- ☐ Main index page with links to all recipes
- ☐ At least 3 recipe pages
- ☐ Each recipe has all required elements
- ☐ All links work correctly
- ☐ All images display properly
- ☐ Proper HTML structure (DOCTYPE, head, body)
- ☐ Meaningful commit history
- ☐ Pushed to GitHub
- ☐ GitHub repository link ready to submit
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:
- _________________________________________
- _________________________________________
- _________________________________________
One thing I want to practice more:
_________________________________________