git log is extremely powerful once you know its options:
git log --oneline # compact view
git log --oneline --graph --all # visual branch graph
git log --stat # show changed files + line counts
git log -p # show full diffs
# Filter by time
git log --since="2 weeks ago"
git log --after="2024-01-01" --before="2024-06-01"
# Filter by author
git log --author="Alice"
# Filter by content (search commit messages)
git log --grep="fix"
git log --grep="bug" -i # case-insensitive
# Filter by what changed in files (pickaxe)
git log -S "functionName" # commits that added/removed that string
git log -G "regex" # commits where diff matches regex
# Range: commits in feature not in main
git log main..feature --oneline
# Formatting
git log --format="%h %an %s" # hash, author name, subject
The repo has several commits. Write a command that prints only commits whose message contains the word "feature" (case-insensitive). Store the count of such commits in a variable and print it.
Click "Run" to execute your code.