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
your folder → git commit → GitHub repository → deployEach 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:
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
- Create an account at github.com and verify your email.
- Turn on two-factor authentication when prompted.
- Click New repository.
- Use a simple lowercase name such as
cafe-website. - Choose Public for class work or Private for personal work.
- 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:
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 mainSwipe sideways if a command is long.
After the first push, your everyday loop is only three commands:
git add .
git commit -m "Describe what changed"
git pushSwipe 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
| Word | Meaning | What you do now |
|---|---|---|
| Repository | One project's folder and history | One project, one repository. |
| Commit | A saved checkpoint with a message | Commit after each working change. |
| Push | Send commits to GitHub | Push before deploying. |
| Branch | A separate line of work | Stay on main for your first builds. |
| Remote | The GitHub connection | Yours is called origin. |
| Pull request | A review workflow | Learn 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
updatethat tell future you nothing. - Deploying before pushing, then wondering why the live site is missing your changes.
- Uploading
node_modulesor 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.