Typorithm · easy

status, diff & log

git-status-loggitstatusdifflog
Saved on this device
Full lesson · 8 learning steps Open any exercise for focused practice
1

Step 1 of 8 · intro card

Learn status, diff & log

0%

Basics

git status shows tracked/untracked and staged/unstaged state; git diff shows unstaged changes while --staged shows staged ones; git log lists history (--oneline is compact); git show HEAD displays the latest commit's diff. HEAD points at the current commit.

git status is your first command in any repo: it lists untracked files and shows which changes are staged versus only modified in the working tree.

git diff shows the changes you have made but not yet staged. git diff --staged (also --cached) shows what is in the index — the changes the next commit will include.

git log lists the commit history, newest first; --oneline collapses each commit to a single compact line. git show HEAD prints the most recent commit, and HEAD is simply a pointer to the current commit.

01

git status shows staged vs unstaged vs untracked.

02

git diff = unstaged; git diff --staged = staged.

03

git log lists history; HEAD is the current commit.

git status
git diff
git diff --staged
git log --oneline
git show HEAD

Read the implementation

Connect each part of the code to the concept before you type.

1. Inspect state

git status shows which files are tracked/untracked and staged/unstaged.

git status

2. Unstaged changes

git diff shows the changes in the working tree that are not yet staged.

git diff

3. Staged changes

git diff --staged shows what is staged in the index, ready to commit.

git diff --staged

4. History

git log lists the commit history; --oneline prints one compact line per commit.

git log --oneline

5. Latest commit

git show HEAD displays the latest commit's message and diff. HEAD points at the current commit.

git show HEAD

A complete learning loop

01

Understand

Read the concept map and follow the code breakdown.

02

Reconstruct

Type the implementation, repair mistakes and work through every recall exercise.

03

Verify

Use the final check without hints; revisit weak concepts in short practice sessions.

status, diff & log: Lesson & Practice · Typorithm | ApplyDjinn