Git & GitHub Without Fear
Understand what Git records, what GitHub adds and how a careful developer moves work from a local folder into a reviewable project. Short explanations lead into six graded, credential-free builds.
Git remembers; GitHub helps people collaborate.
What if your best code disappeared—or yesterday's version was actually better? Git gives your project a memory, so experimenting stops feeling like gambling.
Git and GitHub are related, but they are not the same tool. Git is a distributed version-control system: it records intentional snapshots of files in a repository. It works on your computer and most everyday commands work offline. GitHub is an online service that can host Git repositories and add issues, pull requests, reviews and automated Actions.
Developers use them to understand what changed, return to known work, try ideas on branches, review changes before merging and share projects. Git is useful for HTML, CSS, JavaScript, Python, notes and almost any text-based project.
- Repository
- A project folder plus its Git history.
- Commit
- An intentional snapshot with a message explaining why it exists.
- Branch
- A movable name for a line of work.
- Remote
- A named connection to another repository, often one hosted on GitHub.
- Pull request
- A GitHub conversation for reviewing proposed changes before merging them.
- Star
- An optional bookmark and signal of appreciation. It does not copy a project or affect your grade.
- Template
- An independent starter copy. Use this for KODE Ń VIBE graded projects.
- Fork
- A copy connected to an upstream repository, used when proposing contributions back.
Two-minute check
Install Git first; create GitHub only when sharing begins.
Use the free installation guide for current Windows, macOS and Ubuntu steps. Verify the result with git --version. Git does not require an account. GitHub does: create one at the official site, verify the email, choose a unique password, enable two-factor authentication and store the recovery codes somewhere safe.
git --version
git config --global user.name "Your public name"
git config --global user.email "your-verified-email@example.com"
git config --global init.defaultBranch main
git config --global --list
Your Git name and email label commits; they do not sign you in. For HTTPS authentication, use GitHub CLI or a supported credential manager. Do not paste passwords, one-time codes or access tokens into a repository, screenshot or tutorial.
Setup proof
Inspect, select, record.
A useful beginner model has three states: the working tree contains current files, the staging area selects the exact next snapshot, and HEAD identifies the currently checked-out commit. Use git status between steps so Git explains the state.
mkdir learning-log
cd learning-log
git init
printf "# Learning log
" > README.md
git status
git diff
git add README.md
git diff --cached
git commit -m "docs: start learning log"
git log --oneline --decorate
Stage specific files or even selected lines. Avoid reflexively running git add . before inspecting the diff. A good commit contains one coherent change and a message that helps a future reader understand its purpose.
# Ignore generated and private local files.
node_modules/
.env
dist/
# Keep a safe example file.
!.env.example
.gitignore affects untracked files. It does not erase a secret that Git already tracks or remove it from history.
Why have a staging area?
It lets you choose a clean snapshot from a messy working folder. You can commit one finished idea while leaving unrelated work for later.
Branches make change reviewable.
git switch -c feature/clear-empty-state
# edit, inspect, stage and commit
git push -u origin feature/clear-empty-state
Open a pull request with the problem, the chosen change, screenshots or test evidence, and remaining limits. If Git reports a conflict, read both versions, edit the file into the intended result, test it, stage it and complete the merge. Do not delete markers blindly.
Use the least destructive recovery tool
git restore filediscards an uncommitted file change—inspect first.git restore --staged fileremoves a path from the next snapshot without deleting the working file.git revert <commit>adds a new commit that reverses published history.git reflogcan help locate recently moved local references.
GitHub Actions can automatically run tests for a pushed revision. A green check proves only the programmed checks passed; it does not prove authorship, usability, accessibility or production safety.
Repository three trees
Expose distinct HEAD, staging-area, working-tree and untracked states.
Starter and automated checks are prepared locally · publishing nextStaging and readable history
Create focused commits while deliberately keeping unfinished work aside.
Starter and automated checks are prepared locally · publishing nextBranches and conflict reasoning
Resolve a real content conflict and explain the resulting merge.
Starter and automated checks are prepared locally · publishing nextLocal remote and pull-request packet
Push to a safe local bare remote and prepare review-ready evidence.
Starter and automated checks are prepared locally · publishing nextIgnore, secrets and safe recovery
Prove ignore behaviour and recover common mistakes without destructive shortcuts.
Starter and automated checks are prepared locally · publishing nextCollaboration simulation capstone
Complete an issue-to-review workflow with remote updates, conflict resolution and handoff.
Starter and automated checks are prepared locally · publishing nextCourse finish line
The complete note goes deeper.
The full authoring pack is complete locally and is being prepared for protected delivery. It will include the remaining explanations, practice checks, all staged projects and the final combined build. Payment is not active yet.
- Why version control exists
- Install Git and secure GitHub
- First repository and commit
- Stage, inspect and write readable history
- .gitignore and repository hygiene
- Branches, merges and conflicts
- Remotes, authentication and sync
- Issues and pull requests
- Safe recovery and undo
- Secrets and repository safety
- GitHub Actions
- Frontend collaboration capstone
Primary references reviewed 13 August 2026: Git tutorial · Pro Git: About version control · Install Git · GitHub Hello World · Saving repositories with stars · Create from a template · Working with forks · GitHub credential guidance · Configure two-factor authentication · Pull-request collaboration · Understand GitHub Actions. Explanations and examples are original KODE Ń VIBE teaching material.