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