🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Searching Git History: all 10 questions

Quiz: Searching Git History · Question 2 of 10

You want to know when the code discount = 0.5 was added to the project. What is the best tool?

You want to know when the code discount = 0.5 was added to the project. What is the best tool?

  1. A.git log --grep="discount"
  2. B.git shortlog -sn
  3. C.git log -S"discount = 0.5"
  4. D.git status
Answer & explanation

Correct answer: git log -S"discount = 0.5"

The pickaxe finds commits where that exact text was added or removed in the code.

Can you get the rest right without peeking?

Take the timed Quiz: Searching Git History quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →