Feature ownership and branch-based work
Understand the idea
A fork is your copy of the class's shared starter. The branch you add is where your work lives.
The idea
Forking writes a second whose history starts as a copy, with pointing at the shared starter. That starter is the one your teacher marked for the class. It is class or public so every classmate can fork the same repo.
What changes
git fork their-slug creates your repository and sets forked_from to the shared starter. Their labels are copied. The next commit on your branch moves only your label. Classmates fork the same starter; they do not fork your copy for the standard path.
| Repository | Who writes it | What origin means |
|---|---|---|
| Shared class starter | The teacher (maintainer) | Nothing, until someone forks it |
| Your fork | You | The shared starter you copied |
| A branch on the fork | You | A label on your copy only |
The command
In the classroom, the teacher saves a starter repository. Then run git fork with that slug. git switch -c class-notes, edit README.md, git add README.md, and git commit -m "add fork notes".
The mistake
Check your graph
Your fork shows the starter's old commits plus the new one on class-notes. The starter's main label has not moved.
Your repository
Fork the teacher's shared starter repo, then commit on a branch that the starter does not have.
Step 1
Fork the class starter
Use the shared starter your teacher designated, or greeting-kit if you are practicing alone. Every classmate forks that same repository — not each other’s forks.
Step 2
Branch on your fork
The shared starter’s main stays put. Your work is on this branch of your fork.
Step 3
Write your change
In the editor, add a line to README.md: Notes from my fork.
Step 4
Stage and commit
This commit exists only on your fork.
Step 5
Save it
The graph shows the new commit on class-notes.
The editor edits the working tree. Start a repository and the files appear here.
Commit graph
No commits yet. git init creates the first one.
Quiz
A quick check for understanding. Retry as often as you like; your learning path stays open.
Ready to call this one understood?
Mark this lesson complete to earn 200 XP. You can always revisit it.