🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Git Config, .gitignore and Hooks: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. user.email is set globally to a Gmail address and locally to a college address. Which does Git use in that repository?
  2. Q2. Which command shows which config level a value came from?
  3. Q3. Your .gitignore contains .env. and then !.env.example. What happens to .env.example?
  4. Q4. The pattern /config.local.json is in the root .gitignore. Which file is ignored?
  5. Q5. You added .env to .gitignore, but git status still shows changes to it. Why?
  6. Q6. A real payment key was pushed to GitHub inside .env. What must you do first?
  7. Q7. Why do teams commit a .gitattributes file with text=auto eol=lf?
  8. Q8. What does this print? (code)
  9. Q9. A pre-commit hook script ends with exit 1. What happens?
  10. Q10. Why must CI repeat the checks that your hooks perform?