git log
- Git course
- Beginner
- Lesson 29/80
- 4 min
Learn to view the commit history with git log.
View commit history
git log lists previously created commit records in a repository. Each record contains a commit identifier (hash), author, date, and commit message. You can use it to inspect which records were created and what happened in the project history.
git logA commit hash is a unique identifier for each commit.
Reading commit history
In git log output, the newest commit usually appears at the top of the list. The commit line shows the identifier, Author shows the author, Date shows the date, and the text below contains the commit message.
commit a1b2c3d4e5f6
Author: Ali
Date: Mon Nov 9 10:00:00 2026
Add the first fileWhen multiple commits exist, you can inspect earlier records to track previous work.
Practice Display commit history
Run the git log command in the terminal. Display the commit history in the repository.
Starter code
# Commit geçmişini görüntüle
# Komutu buraya yazSample solution
# Commit geçmişini görüntüle
git logExpected output
commit geçmişi listelenir
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which value uniquely identifies a commit in git log output?
- Commit hash Correct answer
- File name
- Repository folder
- Commit date
Explanation: The commit hash uniquely identifies each commit record.
2 List history records
git ____
git log
Explanation: The <code>git log</code> command lists commit history.
3 Parts of a history record
| Term | Meaning |
|---|---|
commit hash |
Unique commit identifier |
Author |
Person who created the commit |
Date |
Commit creation date |
Commit mesajı |
Text describing the work |