CodeBlanks Logo Icon CodeBlanks

Summary - Log

Combine log options to build a history reading flow.

Read history in different views

You can use different options of the git log command to inspect Git history. The normal view shows the commit identifier, author, date, and message, while --oneline provides a shorter list. --stat summarizes file changes and line counts.

git log
git log --oneline
git log --stat

You can choose one of these views to inspect commit history according to your needs.

Practice Display compact history with statistics

Display commit history with both a one-line view and file change statistics. Add both --oneline and --stat options to the git log command.

Starter code

terminal
# Kısa ve istatistikli geçmişi göster
# Komutu buraya yaz

Sample solution

terminal
# Kısa ve istatistikli geçmişi göster
git log --oneline --stat

Expected output

kısa commit listesi ve değişiklik istatistikleri gösterilir

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 You want to see both a compact commit list and statistics about changed lines in a repository. Which options provide these two views?

  • --author and --email
  • --stat and --oneline Correct answer
  • --status and --commit
  • --init and --config

Explanation: <code>--oneline</code> displays a compact commit list, while <code>--stat</code> shows file and line changes.

2 Complete the history viewing command

Question
git log ____
Answer
git log --oneline --stat

Explanation: The <code>--oneline</code> and <code>--stat</code> options can be used together to inspect compact history and change statistics in the same output.

3 History inspection tools

Term Meaning
git log Detailed commit history
--oneline Compact commit list
--stat File change summary
commit hash Unique commit identifier

All lessons in Beginner