Git's log lets you flip back through your scrapbook and see each page in order, along with who added it and when. git log walks back from HEAD through each page's parent and lists them, newest first.
Log & status
Use Git's log to see your commit history, and check the status of your working directory.
Level 3 was tough. Level 4 will give you a little break. This level is about examining the pages in your scrapbook and the mementos on your tabletop, with two commands that help you get your bearings in any repository: git log and git status.
Flip through the pages
git log
If you have used git log in a terminal, you have probably seen a wall of confusing text. That is exactly what you get there. Here, the commit history drawn as circles connected by arrows literally is the log. Abstract Git concepts, rendered right in front of your eyes.
The working directory
Now forget about logs and commits for a second and focus on the mementos sitting on your tabletop. The tabletop you work on, and the mementos sitting on it, is what Git calls the working directory.
It is often useful to check what is going on there. Maybe you have new mementos, maybe some have changed, maybe some are arranged on the mat and ready to be stuck into the book.
Look at the table
git status gives you the same information as the wall of three columns. It shows exactly what is on your tabletop and what is prepped for the scrapbook.
git status
Right now all three columns are empty: no new files, no changes, nothing staged. Your tabletop is totally clear. Congratulations on having such a clean working directory, not a file or memento in sight.
The safest commands you own
git log and git status are purely informational. They provide useful insight about the current state of your repository and change nothing behind the scenes.
When you are not sure what is going on, or what a command is about to do, run these first. There is no situation in which they make things worse. Told you this would be an easy one.
How to use this page
- slider / ▶Drag the slider, or press play, to watch the command happen. Before and After jump to either end.
- ← → · spaceStep through a multi-step command; space toggles Before / After.
- APlay or pause the loop (the page opens playing). Any manual input takes over.
- hoverA commit shows its message, author, date and parents, with its history highlighted.
- clickCopies the commit sha.
- ctrl + wheelZoom around the cursor (pinch on a trackpad). Double-click resets the view.
- EscStop playback, reset the view, close this menu.
- shareThe Share button copies a link to this graph, copies it as an image, downloads PNG/SVG/page, or posts it. #before, #after or #step=N in the link pins the state.
The graph appears here when the first command runs. The simulations are drawn by git-sim from a real repository.
The scrapbook picture appears as the story is told.
Level 4 complete
Log & status
🎉 New rank unlocked
git log shows the commit history: the pages in the book, newest first. git status shows the working directory: what is on the table and what is on the mat. Both are the safest commands you can run. They never change anything. Onward, to Level 5.
Get new levels and walkthroughs
New lessons and command walkthroughs, plus a Git trick or two. Your progress stays saved in this browser either way.
Free: the Git essentials cheat sheet
The 16 Git commands you'll use most, each with a picture of what it does to your repo, drawn by git-sim, on one printable sheet. Or pick your own 16. We'll email it to you, along with new levels and walkthroughs.