← Quiz: LinkedIn and GitHub: all 10 questions
Quiz: LinkedIn and GitHub · Question 10 of 10
How should you keep secrets such as API keys out of a GitHub project?
How should you keep secrets such as API keys out of a GitHub project?
- A.Store them in a .env file and add .env to .gitignore
- B.Write them in the README
- C.Put them in a comment at the top of the code
- D.Commit them, then delete them in the next commit
Answer & explanation
Correct answer: Store them in a .env file and add .env to .gitignore
Deleting later is not enough; the key stays in the commit history.
Can you get the rest right without peeking?
Take the timed Quiz: LinkedIn and GitHub quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →