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

Quiz: Git Config, .gitignore and Hooks · Question 3 of 10

Your .gitignore contains .env. and then !.env.example. What happens to .env.example?

Your .gitignore contains .env.* and then !.env.example. What happens to .env.example?

  1. A.It is ignored
  2. B.It is tracked, because the later ! rule un-ignores it
  3. C.Git reports an error for conflicting rules
  4. D.It is deleted
Answer & explanation

Correct answer: It is tracked, because the later ! rule un-ignores it

For .gitignore, the last matching pattern wins.

Can you get the rest right without peeking?

Take the timed Quiz: Git Config, .gitignore and Hooks quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →