A hands-on workshop for publishing your first website using Git and GitHub Pages.
2026-Git-2.2.pptx- Lecture slidesindex.html- Website templatestyle.css- Stylingscript.js- Interactive features
# Navigate to your Desktop (or wherever you want to save your project)
cd ~/Desktop
# Clone the template repository
git clone https://github.com/mitchellxh/git-workshop-2.git
# Go into the project folder
cd git-workshop-2Verify the files are there:
ls -l- Open
index.htmlin your text editor - Find
YOUR_USERNAMEand replace it with your GitHub username - Change the heading "Welcome to My GitHub Page!" to something personal
- Save the file
# Check what changed
git status
# Stage all changes
git add .
# Commit with a descriptive message
git commit -m "Personalize my GitHub page"- Go to GitHub.com
- Click the + icon (top right) → New repository
- Name it something like
my-first-website - Keep it Public
- Don't initialize with README (we already have files)
- Click Create repository
# Remove the template remote
git remote remove origin
# Add your repository as the new remote
git remote add origin git@github.com:YOUR_USERNAME/my-first-website.git
# Push to GitHub
git push -u origin mainIf you get an error about main not existing:
git branch -M main
git push -u origin main- Go to your repository on GitHub.com
- Click Settings
- Click Pages in the left sidebar
- Under Source, select Deploy from a branch
- Under Branch, select main, leave folder as / (root)
- Click Save
- Click the Actions tab to watch the build
After 2-5 minutes, your site will be live at:
https://YOUR_USERNAME.github.io/my-first-website/
Practice the full Git workflow:
# 1. Edit a file (try changing colors in style.css)
# 2. Check what changed
git status
# 3. Stage changes
git add .
# 4. Commit
git commit -m "Update site styles"
# 5. Push to GitHub
git pushYour GitHub Pages site will automatically update!
Remember: Save → Add → Commit → Push
| Command | What it does |
|---|---|
git clone [url] |
Copy a repository to your computer |
git status |
See what files have changed |
git add . |
Stage all changes for commit |
git commit -m "message" |
Save changes with a description |
git push |
Upload changes to GitHub |
git pull |
Download changes from GitHub |
| Problem | Solution |
|---|---|
| "Permission denied" | Make sure you're using SSH URL and your key is added to GitHub |
| "Failed to push" | Run git pull first, then git push |
| Can't see Pages site | Wait 5-10 minutes, verify URL, check Pages is enabled in Settings |
| "Please tell me who you are" | Run git config --global user.name and user.email (see Part 1 workshop) |