GitHub Basics
Station 4 / 11
BMFeedback

Builder Toolkit · 04 / 11

GitHub Basics

Create a repository, set your Git identity, commit, push, and understand what version control gives you.

GitHub Basics

What this is

Git records versions of your project on your computer. GitHub stores a copy of that history online.

They are two different things with confusingly similar names. Git is the tool. GitHub is the website.

The one idea

A commit is a save point you can return to. A push copies your save points to GitHub.

Why it matters

Without this, your project exists in exactly one place and one state. A bad AI edit, a deleted folder, or a dead laptop takes all of it.

With it, you can undo a bad change, show a tutor exactly what you did, and connect the project to a deployment tool. Deployment reads from GitHub, so nothing ships until this step works.

What to do

Understand the flow

Copy
your folder → git commit → GitHub repository → deploy

Each arrow is a separate action you trigger. Nothing happens automatically.

Set your identity first

Git refuses to commit if it does not know who you are, and the error message does not make that obvious. Set it once per machine:

Terminal command
git config --global user.name "Your Name"
git config --global user.email "your@email.com"

Swipe sideways if a command is long.

Use the same email as your GitHub account so your commits are linked to you.

The silent blocker

An unset identity is the most common reason a first commit fails in class. It looks like a broken repository. It is two lines of config.

Create the account and repository

  1. Create an account at github.com and verify your email.
  2. Turn on two-factor authentication when prompted.
  3. Click New repository.
  4. Use a simple lowercase name such as cafe-website.
  5. Choose Public for class work or Private for personal work.
  6. Do not add a README if you are pushing a project that already exists locally.

That last point matters. Adding a README creates a first commit on GitHub that your local project does not have, and the two histories then refuse to merge.

Push an existing project

Run these inside your project folder:

Terminal command
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/USERNAME/REPO-NAME.git
git push -u origin main

Swipe sideways if a command is long.

After the first push, your everyday loop is only three commands:

Terminal command
git add .
git commit -m "Describe what changed"
git push

Swipe sideways if a command is long.

Do this now

Run git status in your project folder. It tells you what has changed since your last commit. Get in the habit of running it before every commit.

Check yourself

Learn the words

WordMeaningWhat you do now
RepositoryOne project's folder and historyOne project, one repository.
CommitA saved checkpoint with a messageCommit after each working change.
PushSend commits to GitHubPush before deploying.
BranchA separate line of workStay on main for your first builds.
RemoteThe GitHub connectionYours is called origin.
Pull requestA review workflowLearn later. Not needed to ship.

If push is rejected

Usually the remote URL is wrong or the repository already has commits yours does not. Check the URL with git remote -v and fix it with git remote set-url origin <correct-url>.

Common mistakes

  • Committing without setting your Git identity, then reading the failure as a broken install.
  • Creating the GitHub repo with a README, then fighting a merge conflict on the first push.
  • Writing commit messages like update that tell future you nothing.
  • Deploying before pushing, then wondering why the live site is missing your changes.
  • Uploading node_modules or a secrets file, which the next page prevents.

Next step

Before you push anything else, learn what must never leave your machine: Gitignore and Secrets.