a bedtime story about GitHub
The Never-Lost Story
Turn the pages with the arrows, your arrow keys, or a swipe.
chapter one
Two helpers
Maya, Leo and Priya were making a game about a llama who lived on the Moon. But whenever two of them worked at once, somebody's work got erased. Oh no! So they called two helpers.
Tap the button to take a picture of the game.
chapter two
A chest for everything
First they needed one safe place to keep it all. They found a treasure chest on the Moon and called it a repository. Repo, for short!
What's inside? Open it and see.
A public repo is like a library book: anyone can read it. A private repo is like a diary: only invited friends can open it.
chapter three
A sky full of save points
Every time they finished something, they made a commit. Each commit became a star in the sky, with a little note saying what changed. Tap a star to fly back in time!
chapter four
Leo's wild idea
Leo had a wild idea: the llama should breathe fire! To try it without breaking the game, he started his own trail of stars. That's called a branch.
chapter five
A letter that asks
The fire breath worked! But on a good team, a friend checks your work first. So Leo sent a pull request, a letter that asks, “Can we add this?”
story.txt
The llama could not do anything special.
When the llama sneezes, she breathes blue fire.
Bolt the robot uses it to toast cheese.
chapter six
Pink or gold?
One day Maya painted the spaceship pink. At the very same time, Leo painted it gold. Bolt the robot beeped: “Two changes on the same line! A person has to pick.” That's a merge conflict.
Inside the file, Git marks the clash with arrows like <<<<<<< and >>>>>>> so you can find it.
chapter seven
Moving to the front
While Leo worked on his trail, Priya added a new star to main. Leo's stars were left behind! So he did a rebase: he lifted his stars and set them down right after Priya's.
chapter eight
Copies for new friends
Kids at another school loved Space Llama! A clone beamed a copy down to their laptop. A fork gave them their very own copy on GitHub, so they could draw a brand-new ending.
Try both. Watch where each copy goes.
chapter nine
Up and down
Maya wrote a new line on her laptop. Priya drew a new Moon on GitHub. To share your work, you push it up. To catch up, you pull your friends' work down.
Maya's laptop
GitHub
chapter ten
The llama's riddles
the end
The star dictionary
You learned the big words. Here they are, plus a few more you'll hear coders say.
Saving your work
- Commit
- A save point with a short note about what changed.
- Diff
- Shows exactly what changed. Plus lines are new, crossed-out lines are removed.
- HEAD
- A "you are here" pin that marks the commit you're looking at.
- Stash
- Puts unfinished changes in a drawer so you can come back to them later.
- Tag
- A name sticker on an important commit, like "Version 1.0."
Working together
- Branch
- A safe copy where you can try a new idea.
- Merge
- Joining a branch's changes back into main.
- Merge conflict
- Two people changed the same line, so a person has to pick what stays.
- Rebase
- Moving your commits on top of the newest main, so history is one straight line.
- Fast-forward
- A merge where main has nothing new, so Git just slides main up to your newest commit.
- Squash
- Squeezing lots of small commits into one tidy commit, like stapling your rough drafts into one final page.
- Cherry-pick
- Copying just one commit from another branch, like picking one cherry from a bowl.
- Pull request
- Asking your team to check your changes and add them.
- Code review
- Teammates reading your changes and giving feedback before they're added.
Sharing copies
- Repository
- The project's home. It holds every file and its whole history.
- Clone
- Copying a repo onto your computer.
- Fork
- Copying someone else's repo into your own GitHub account.
- Push
- Sending your commits up to GitHub.
- Pull
- Bringing your team's new commits down to your computer.
- Fetch
- Checking GitHub for new commits without mixing them into your work yet.
- Remote
- The copy of your repo that lives on GitHub. Its usual nickname is "origin."
- Prune
- Cleaning out old branches that were already deleted on GitHub, like trimming dead branches off a tree.
On GitHub
- Issue
- A to-do note or bug report, like "The llama falls through the floor."
- Star
- A bookmark that also tells the team "I like this project."
- README
- The cover page that explains what a project is.
- .gitignore
- A list of files Git should skip, like giant videos or secret passwords.
- Release
- A finished version that people can download, like Space Llama 1.0.
- Actions
- Robot helpers that do jobs on their own, like testing the game every time someone pushes.