GitHub Basics
Outcome: You'll understand how to sync your work and collaborate using GitHub.
Why GitHub Matters
Everything you create lives in your local workspace. GitHub is how you:
- Back up your work - Your files exist in the cloud, not just on your machine
- Sync across devices - Work from your laptop, then pick up on your desktop
- Collaborate - Share repos with teammates, see each other's changes
- Version control - Go back to previous versions if something breaks
If you've never used Git before, don't worry. GitHub Desktop makes it simple.
The Core Concepts
| Term | What It Means |
|---|---|
| Repository (Repo) | A folder that Git tracks. All your project files live here. |
| Commit | A snapshot of your changes. Like saving a version. |
| Push | Send your commits to GitHub (the cloud). |
| Pull | Get the latest changes from GitHub to your local machine. |
| Branch | A parallel version of your repo. Useful for experiments. |
For now, you only need to know: Commit (save changes) and Push (sync to cloud).
The Daily Workflow
When you finish working:
- Open GitHub Desktop
- You'll see a list of changed files on the left
- Write a short summary of what you did (bottom left)
- Click "Commit to main"
- Click "Push origin" (top right)
That's it. Your work is now backed up and synced.
When you start working on a different machine:
- Open GitHub Desktop
- Click "Fetch origin" (checks for updates)
- If there are changes, click "Pull origin"
- Your local files are now up to date
Hands-On: Make Your First Commit
Let's practice the workflow right now.
- Create or edit any file in your repo (add a note, make a change)
- Open GitHub Desktop
- See your change listed in the left panel
- In the "Summary" field, type: "My first commit"
- Click "Commit to main"
- Click "Push origin"
Go to github.com and navigate to your repo. You'll see your commit there.
The habit: Commit and push at the end of each work session. Small, frequent commits are better than one massive one.
When Things Go Wrong
"I made changes on two machines and now there's a conflict"
This happens when you edit the same file in two places before syncing. GitHub Desktop will show a merge conflict.
The simple fix: Talk to Claude. Paste the conflict markers and ask it to help you resolve which changes to keep.
"I want to undo my last commit"
In GitHub Desktop: History tab → Right-click the commit → "Revert changes in commit"
This creates a new commit that undoes the previous one. Safe and traceable.
Best Practices
| Do | Don't |
|---|---|
| Commit at the end of each work session | Wait weeks between commits |
| Write descriptive commit messages | Use vague messages like "updates" |
| Pull before starting work on a shared repo | Assume your local copy is current |
| Keep commits focused (one topic per commit) | Lump unrelated changes together |
Quick Reference
| Action | Where to Click |
|---|---|
| See what changed | Left panel in GitHub Desktop |
| Commit changes | Bottom left: write message → "Commit to main" |
| Push to cloud | Top right: "Push origin" |
| Get latest from cloud | Top: "Fetch origin" → "Pull origin" if updates exist |
| Undo a commit | History tab → Right-click → "Revert changes in commit" |