All use Git under the hood - the collaboration features differ
For this course: GitHub hosts the labs, workflows, badges, and submissions
Git and GitHub
This is a common point of confusion.
Git: is the software tool that runs on your computer. It does the actual work of tracking changes. (Think of it like Microsoft Word.)
GitHub: is a website that stores your Git projects in the cloud. It’s where you share your code and collaborate. (Think of it like OneDrive or Google Docs.)
The core workflow
Remote (GitHub): a project lives on GitHub.
git clone: you create a local copy of the repository and its history.
Local (your computer): you edit files, write code, and fix bugs.
git add & git commit: you save a snapshot (a commit) of your changes to your local history.
git push: you upload your new commits from your computer back to GitHub.
Key terminology
Repository (repo): a folder that contains your project and its entire history.
Commit: a snapshot of your files at a specific point in time; a saved checkpoint.
Staging area: a temporary holding place where you gather the changes you want to include in your next commit.
Push: the command to send your committed changes from your local computer to GitHub.
Core Git commands
git clone <url> - Download a repository from GitHub to your computer
git status - See what files have changed and what’s ready to commit
git add <file> - Stage a specific file for your next commit, once you have reviewed it
git commit -m "message" - Save your staged changes with a descriptive message
git push - Send your commits from local to remote
The Git workflow in action
Here’s what the commands actually look like:
# Check what's changed$ git statusOn branch mainChanges not staged for commit:modified: hello.py# Stage your changes$ git add hello.py# Commit with a message$ git commit -m"Fix greeting message"[main 1a2b3c4] Fix greeting message1 file changed, 1 insertion(+), 1 deletion(-)# Push to GitHub$ git push origin main
Live demo time!
We’ll create repositories two ways, then walk through the basic Git workflow:
Method 1: GitHub first - Create repo on GitHub → git clone
Method 2: Local first - Create local repo → connect to GitHub
graph LR
A[Working Directory<br/>Your files] --> B[Staging Area<br/>git add]
B --> C[Repository<br/>git commit]
C --> D[Remote GitHub<br/>git push]
style A fill:#ffcccb
style B fill:#ffffcc
style C fill:#ccffcc
style D fill:#ccccff
Working Directory: where you edit files
Staging Area: where you prepare what to commit
Repository: your local Git history
Remote: your project on GitHub
Common Git scenarios and fixes
“I made a typo in my commit message”
git commit --amend -m "New message"
“I want to see what I changed”
git diff (before staging) or git diff --staged (after staging)
“I staged the wrong file”
git reset HEAD <file> to unstage
“Authentication failed”
Make sure you’re using your PAT, not your GitHub password
Want to learn more?
Useful resources for learning Git and GitHub:
Pro Git Book - A free reference; chapters 1–3 cover the course foundations
GitHub Skills - Interactive tutorials directly on GitHub
# Getting startedgit clone <url># Download a repositorygit status # See what's changedgit log --oneline# View commit history# Making changesgit add <file># Stage a specific file you have reviewedgit commit -m"message"# Save your changesgit push # Send to GitHub# Fixing mistakesgit diff # See what changedgit reset HEAD <file># Unstage a filegit commit --amend# Fix last commit message
Time for Lab 01
Your first hands-on lab: Git and GitHub fundamentals.
Objective: fork the semester labs repository, clone your fork, complete the setup record, and push it to GitHub.
Submit that one fork URL to Canvas; you will keep using it through Lab 14.
Please navigate to week01/lab01.md in the course repository for step-by-step instructions.