We’ll simulate the collaborative workflow for Morgan and Jamie using Git and GitHub, following the provided objectives and tasks. This step-by-step guide will cover setting up the repository, creating the initial website files, simulating Morgan’s and Jamie’s contributions, and merging their changes via pull requests, all while ensuring a smooth collaborative process.
Prerequisites
Git Installed: Ensure Git is installed (download from git-scm.com if needed).
GitHub Account: You have a GitHub account and are logged in.
Visual Studio Code (VS Code): Installed for editing files (download from code.visualstudio.com if needed).
GitHub Authentication: Set up authentication via SSH, personal access token, or GitHub CLI.
Terminal: Use a command-line interface (e.g., Command Prompt/PowerShell on Windows, Terminal on macOS/Linux).
Create a New Repository on GitHub:
Go to github.com and sign in.
Click the “+” icon in the top-right corner and select “New repository.”
Set the repository name to greenwood-library-website.
Check “Add a README file” to initialize with README.md.
Keep it public or private as preferred.
Click “Create repository.”
Clone the Repository Locally:
Copy the repository URL (e.g., https://github.com/your-username/greenwood-library-website.git).
Open your terminal and clone the repo:
mkdir greenwood-library-project
cd greenwood-library-project
git clone https://github.com/your-username/greenwood-library-website.git
cd greenwood-library-website
We’ll create the basic website files (home.html, about_us.html, events.html, contact_us.html) with random content using VS Code and commit them to the main branch to simulate the existing codebase.
Open the Project in VS Code: bash
code .
This opens the greenwood-library-website directory in VS Code.
Create HTML Files with Random Content:
In VS Code, create the following files in the repository root and add simple HTML content:
home.html: copy the code and paste in the file
<!DOCTYPE html>
<html>
<body>
<h1>Welcome to Greenwood Community Library</h1>
<p>Explore our collection and join our community!</p>
</body>
</html>about_us.html:
<!DOCTYPE html>
<html>
<body>
<h1>About Us</h1>
<p>We are a community-driven library fostering knowledge and connection.</p>
</body>
</html>events.html:
<!DOCTYPE html>
<html>
<body>
<h1>Upcoming Events</h1>
<p>Stay tuned for exciting library events!</p>
</body>
</html>contact_us.html:
<!DOCTYPE html>
<html>
<body>
<h1>Contact Us</h1>
<p>Email: [email protected] | Phone: (123) 456-7890</p>
</body>
</html>Save all files.
Stage, Commit, and Push to main: In the terminal, run:
git add .
git commit -m "Add initial website files: home, about_us, events, contact_us"
git push origin main
Go to https://github.com/your-username/greenwood-library-website.
Confirm that README.md and the four HTML files (home.html, about_us.html, events.html, contact_us.html) are present in the main branch.
Morgan will create a book_reviews.html file in a new branch called add-book-reviews, push it to GitHub, and raise a pull request.
Create and Switch to Morgan’s Branch:
git checkout -b add-book-reviews
Create book_reviews.html:
In VS Code, create a new file book_reviews.html in the repository root with random content:
book_reviews.html
<!DOCTYPE html>
<html>
<body>
<h1>Book Reviews</h1>
<p>Read what our community thinks about their favorite books!</p>
<ul>
<li>"The Great Gatsby" - A timeless classic!</li>
<li>"1984" - Thought-provoking and intense.</li>
</ul>
</body>
</html>Save the file
Stage, Commit, and Push to main: In the terminal, run:
git add book_reviews.html
git commit -m "add book reviews section"
git push origin add-book-reviews
Go to https://github.com/your-username/greenwood-library-website.
You’ll see a prompt suggesting the recently pushed add-book-reviews branch; click “Compare & pull request.” Alternatively, go to the “Pull requests” tab and click “New pull request.”
Set: Base branch: main
Compare branch: add-book-reviews
Review the changes (GitHub shows the new book_reviews.html file).
Add a title: “Add Book Reviews Section”
Add a description: “Created book_reviews.html with sample book reviews.”
Click “Create pull request.”
Merge Morgan’s Pull Request: In the “Pull requests” tab, open the PR.
Review the changes (confirm book_reviews.html is added correctly).
Click “Merge pull request” and then “Confirm merge.”
Optionally, click “Delete branch” to remove add-book-reviews from GitHub.
Result: The main branch now includes book_reviews.html
Jamie will update events.html in a new branch called update-events, pull the latest main branch to stay updated, push changes, and raise a pull request.
Create and Switch to Jamie’s Branch:
git checkout main
git pull origin main # Ensure local main is up-to-date
git checkout -b update-events
Update events.html:
In VS Code, open events.html and modify it to include new event details, e.g.:
<!DOCTYPE html>
<html>
<body>
<h1>Upcoming Events</h1>
<p>Join us for these exciting community events!</p>
<ul>
<li>Book Club: Oct 15, 2025 - Discuss "To Kill a Mockingbird"</li>
<li>Author Talk: Oct 20, 2025 - Meet Jane Doe</li>
</ul>
</body>
</html>Save the file.
Pull Latest Changes from main:
Since Morgan’s changes (adding book_reviews.html) were merged into main, pull those updates into Jamie’s branch to avoid conflicts: bash
git pull origin main
If no conflicts occur, Git will fast-forward or merge automatically (since Jamie only modified events.html and Morgan added a new file, there should be no conflicts).
If a conflict occurs (unlikely here), Git will mark it in events.html. Resolve it by editing the file, then stage and commit: bash
git add events.html
git commit -m "Resolved merge conflict with main"
then Stage, Commit, and Push Changes:
git add events.html
git commit -m "Update events page with new community events"
git push origin update-events
Go to https://github.com/your-username/greenwood-library-website.
Click “Compare & pull request” for the update-events branch or create a new PR manually.
Set: Base branch: main
Compare branch: update-events
Review the changes (GitHub shows the updated events.html).
Add a title: “Update Events Page with New Events”
Add a description: “Added upcoming community events to events.html.”
Click “Create pull request.”
Merge Jamie’s Pull Request: Open the PR in the “Pull requests” tab.
Review the changes (confirm events.html updates).
Click “Merge pull request” and “Confirm merge.”
Optionally, delete the update-events branch.
Result: The main branch now reflects Jamie’s updated events.html.
You’ve successfully completed the Capstone Project by:
Setting up the greenwood-library-website repository on GitHub.
Creating and committing initial website files (home.html, about_us.html, events.html, contact_us.html) to the main branch.
Simulating Morgan’s work by adding book_reviews.html in the add-book-reviews branch, creating a PR, and merging it.
Simulating Jamie’s work by updating events.html in the update-events branch, pulling the latest main to stay updated, creating a PR, and merging it.
Verifying that all changes are correctly integrated in the main branch.
This project demonstrates key Git and GitHub workflows: cloning, branching, committing, pushing, creating pull requests, and merging changes collaboratively. The Greenwood Community Library website now has a new “Book Reviews” section and an updated “Events” page, ready for further enhancements.













