Setup
You'll need Git installed and a GitHub account. Then pick a scratch directory:
mkdir hello-sof-ai && cd hello-sof-ai
git init
That creates a hidden .git/ directory — the beating heart of your repo.
Make a change
Create a file:
echo "# Hello, sof.ai" > README.md
Now check the repo's status:
git status
Git tells you README.md is untracked. Git only tracks files you tell it
to.
Stage, commit, push
git add README.md
git commit -m "Add README"
Congratulations — you have a commit. Inspect it:
git log
You'll see your commit with a hash, your name, a date, and the message.
To push to GitHub, create a repo on github.com, then:
git remote add origin https://github.com/<you>/hello-sof-ai.git
git branch -M main
git push -u origin main
What just happened
Three things live in Git at all times:
- Working tree — the files you actually edit.
- Staging area (index) — a list of changes you've said "I want to include these in the next commit."
- Repository history — the immutable chain of commits.
git add moves things from the working tree to the staging area.
git commit turns the staging area into a new snapshot in history.
git push sends new snapshots to a remote (like GitHub).
Exercise
Ask the AI tutor: "What's the difference between git add . and git add -A? Is one safer?"
Then try it yourself. Make two files, add one, commit, and see what happens.
The habit to build: commit often, with messages that say why, not what. A good commit message completes the sentence "This commit will…".