Git Commit History Quiz
Unlock the secrets of your project's past. Learn to navigate the commit log, search for specific changes, and visualize the history graph like a pro.
Question 1
Which command displays the commit history of the current branch in reverse chronological order?
Question 2
Every commit in Git is identified by a unique string of characters (e.g., `a1b2c3d...`). What is this identifier called?
Question 3
You want to see a condensed version of the log, showing only the commit hash and the subject line for each commit. Which command achieves this?
Question 4
You are looking for a commit where you added a function named `calculateTotal`. Which command searches the *content* of the changes (the diffs) for this string?
Question 5
You want to search for a commit based on the text in its *commit message* (e.g., finding a commit that mentions 'bug fix'). Which command does this?
Question 6
Which command displays the commit history as a text-based graph, showing branching and merging lines?
Question 7
You want to see the details of a specific commit (the diff, author, message) identified by the hash `a1b2c3d`. Which command do you use?
Question 8
You want to see the last 3 commits only. Which command limits the output?
Question 9
What does the `--stat` option do in `git log --stat`?
Question 10
You want to see the history of a *specific file* named `app.js` (including renames). Which command is best?
Question 11
In the output of `git log --oneline --graph --all`, you see asterisks `*` and lines `| / `. What do the asterisks represent?
Question 12
You want to view commits that were created *after* a specific date, e.g., Jan 1st, 2023. Which flag do you use?
Question 13
What does `git log -p` display?
Question 14
You want to see only the commits authored by 'John Doe'. Which command filters the log this way?
Question 15
What is the difference between `git log` and `git reflog`?
Question 16
You want to format the log output to show 'Hash - Author - Message'. Which command allows you to define this custom format?
Question 17
Which command shows the history of all branches, not just the current one?
Question 18
You see a commit hash `e83c5163316f89bfbde7d9ab23ca2e25604af290`. Can you use just the first few characters (e.g., `e83c516`) to reference it?
Question 19
What does `git log master..feature` show?
Question 20
You want to see which files changed in each commit, but not the diffs themselves. Which flag is more concise than `--stat`?
Question 21
How do you view the commit history of a function `myFunction` in `file.js`, specifically looking for when the function definition itself changed?
Question 22
What does the `HEAD` pointer in `git log` output represent?
Question 23
You want to see commits that modified `css/style.css` AND `index.html` in the same commit. How do you search for this?
Question 24
Which command shows the log with relative dates (e.g., '2 hours ago') instead of full timestamps?
Question 25
You want to verify the GPG signature of signed commits in the log. Which flag enables this?
