Which command shows a compact one-line history with branch graph?

git log
git log —oneline —graph —decorate
git show —graph

How do you see the changes introduced by the current HEAD commit?

git diff HEAD^..HEAD —name-status
git show HEAD
git status —show

Which command compares staged changes to the last commit?

git diff
git diff —staged
git diff —HEAD

How do you limit the log to the last 5 commits?

git log —max=5
git log -n 5
git show -n 5

Which option helps find commits that added or removed a specific string?

—grep
-S
-U