Skip to main content

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

TermWhat It Means
Repository (Repo)A folder that Git tracks. All your project files live here.
CommitA snapshot of your changes. Like saving a version.
PushSend your commits to GitHub (the cloud).
PullGet the latest changes from GitHub to your local machine.
BranchA 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:

  1. Open GitHub Desktop
  2. You'll see a list of changed files on the left
  3. Write a short summary of what you did (bottom left)
  4. Click "Commit to main"
  5. Click "Push origin" (top right)

That's it. Your work is now backed up and synced.

When you start working on a different machine:

  1. Open GitHub Desktop
  2. Click "Fetch origin" (checks for updates)
  3. If there are changes, click "Pull origin"
  4. Your local files are now up to date

Hands-On: Make Your First Commit

Let's practice the workflow right now.

  1. Create or edit any file in your repo (add a note, make a change)
  2. Open GitHub Desktop
  3. See your change listed in the left panel
  4. In the "Summary" field, type: "My first commit"
  5. Click "Commit to main"
  6. 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

DoDon't
Commit at the end of each work sessionWait weeks between commits
Write descriptive commit messagesUse vague messages like "updates"
Pull before starting work on a shared repoAssume your local copy is current
Keep commits focused (one topic per commit)Lump unrelated changes together

Quick Reference

ActionWhere to Click
See what changedLeft panel in GitHub Desktop
Commit changesBottom left: write message → "Commit to main"
Push to cloudTop right: "Push origin"
Get latest from cloudTop: "Fetch origin" → "Pull origin" if updates exist
Undo a commitHistory tab → Right-click → "Revert changes in commit"