Rullst AcademyRullst Academy/Lesson
Git: every change counts · Lesson 04 / 10

Read changes and history

Before recording another version, inspect what changed. Useful history is a sequence of understandable decisions.

Learning paths12 min

Let's discover together

  1. 1

    Start from the first commit containing sensor. Now ideas.txt contains sensor and motor, one per line. git diff compares the working file with staging; before add, it shows the added motor line.

  2. 2

    In status --short, the first column describes staging relative to the last commit; the second describes the working file relative to staging. A space followed by M means an unstaged modification.

  3. 3

    After git add ideas.txt, git diff --staged shows the selected change; M moves to the first column. Empty git diff means working file and staging agree, not that the last commit changed.

  4. 4

    Commit Add motor. git log --oneline lists recent commits first; hashes and dates vary. git show HEAD:ideas.txt displays the file in the current commit without restoring over your working file. Press q to exit a pager if one opens.

GIT · .md

Your change laboratory

This page’s experiments show prepared outputs. To run real commands, use a new practice folder on your computer and the guide included in “Download activity”. Read the instructions before each command.

My files and GitHub

The editor below saves your Markdown notes in this browser. Download a copy to take them to another device. Sending that file to GitHub does not send your computer’s .git history.

FROM LESSON TO PRACTICE

A guide to follow at your pace

Read the steps before using the reference below. Commands run in the indicated system’s terminal; signup happens on the official site. Rullst Academy exercises are practice and do not verify your installation or external account.

git diff -- ideas.txt
git add ideas.txt
git diff --staged
git commit -m "Add motor"
git log --oneline
git show HEAD:ideas.txt

Official links and next step

✦
YOUR MISSION

Interpret status columns and inspect diff, log and show.

Now it's your turn

Discovery workshop

Read the state, choose the next step

The first commit contains only sensor. The saved file now contains sensor and motor on separate lines. The first scenario checks before add; the second stages that edit and checks again. Notice the spaces: the two columns mean different things. Prepared outputs.
Mini experiment

Learning simulation: compare cards and check your predictions. The browser is not compiling Rust or starting a server.

git status --short -- ideas.txt
Build your answers and check when you are ready.
A moment to understand

Does empty git diff after add mean a commit happened?

I need a hint

Each diff compares two specific states.

Loading your journey…

Take it with you

After the second commit, run git show HEAD~1:ideas.txt and compare with HEAD. Add a third line, stage, then edit again: what does MM tell you? Review and commit your choice before continuing.

At your own pace

My files and GitHub

Every lesson can become your own record: code, notes or a practice plan. Saving a file to GitHub is optional and does not change your XP.

Student guide

The editor and downloads open when this lesson is available to your account. Check access below or return to the track map.

Checking your access to this lesson…

Rullstpetbot

AI can make mistakes. Check the lesson material.