EruditeWBT Course Git Hands-On
Version control

Git protects your work, explains your progress, and makes collaboration possible.

Git is not just an upload tool. It is your history system. It shows what changed, when it changed, and why it changed. This page takes you from a first local repo to the core commands you need for real team work.

Mental model

What Git actually tracks

Working directory

The files you are editing now.

Staging area

The files you intentionally prepare for the next commit.

Commit history

Saved checkpoints with messages that explain the change.

Remote

A hosted copy, usually on GitHub, where collaboration and backup happen.

Simple workflow Edit files -> check git status -> add what belongs together -> commit with a useful message -> push when ready.
Copy and run

Activity 1: Create your first repo

mkdir git-practice
cd git-practice
git init
echo "# Git Practice" > README.md
git status
git add README.md
git commit -m "Add initial README"
Success check After the commit, git status should say your working tree is clean.
What you learned Repo creation, tracking a file, and creating a clean first checkpoint.
Daily commands

The commands you will use the most

See changes

git status

Add selected files

git add README.md
# or
git add .

Commit

git commit -m "Explain what changed"

See history

git log --oneline

See unstaged diffs

git diff

See staged diffs

git diff --staged
Branches

Use branches when a change deserves its own lane

git branch feature-homepage
git switch feature-homepage
# make changes
git add .
git commit -m "Build homepage draft"

Check branches with:

git branch

Switch back:

git switch main
Remote work

Connect to GitHub and push

git remote add origin https://github.com/yourname/your-repo.git
git branch -M main
git push -u origin main

After this, future pushes are often just:

git push
Pulling and syncing

When other people or GitHub have newer work

git pull

If you only want the latest remote info first:

git fetch

Then inspect and merge intentionally.

Important hygiene

Use a .gitignore early

Create a file named .gitignore and add things that should not be committed.

__pycache__/
*.pyc
.env
node_modules/
.vscode/

Adjust it for your actual project. The point is to keep history focused on real source files.

Recovery basics

Safe beginner rescue commands

Unstage a file
git restore --staged filename
Discard local changes in one file
git restore filename
See what happened recently
git log --oneline --decorate --graph
Important Avoid destructive Git commands until you understand them. A clean status check and a clear commit habit prevent most beginner disasters.
Community use

How Git fits in the EruditeWBT community

1 Use commits as proof of work.
2 Push small working increments instead of waiting for perfection.
3 Send your email if a collaboration repo needs access approval.
4 Link your repo when asking for help so others can see what you actually built.

What to do next