CodeBlanks Logo Icon CodeBlanks

Summary - Advanced log

Combine log options to produce a custom history report.

Combine Advanced Log Options

You can combine graph, custom format, and date filters to inspect Git history in greater detail. --graph displays branching relationships, while --format organizes output fields. --since selects only commits after the specified date.

git log --graph --since="2026-01-01" --format="%h %an %s"

Practice Prepare a Custom History Report

Assign a Git command to command with these features: display the branching graph, filter commits after January 1, 2026, and print the abbreviated commit hash, author name, and commit subject in that order. Separate the fields with |. Finally, print the command.

Starter code

terminal
// Özel geçmiş raporu komutunu oluştur
const command = "";

// Komutu yazdır

Sample solution

terminal
const command = 'git log --graph --since="2026-01-01" --format="%h | %an | %s"';
console.log(command);

Expected output

git log --graph --since="2026-01-01" --format="%h | %an | %s"

Questions and answers

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

1 Which command is suitable for a report requiring a branch graph, custom commit fields, and a date filter?

  • git status --graph --since="2026-01-01"
  • git log --until="2026-01-01" --oneline
  • git log --format="%h %s"
  • git log --graph --since="2026-01-01" --format="%h %an %s" Correct answer

Explanation: The second command uses a graph, a starting date, and a custom output format simultaneously.

2 Complete the Report Command

Question
git log --graph --since="2026-05-01" --format="%h %s"____
Answer
git log --graph --since="2026-05-01" --format="%h %s"--since="2026-05-01"

Explanation: The report should display only commits after May 1, 2026. Therefore, you must specify the starting date with --since.

3 Advanced Log Report

Term Meaning
--graph Branching graph
--format Custom output layout
--since Starting date filter
%s Commit subject

All lessons in Advanced