🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Store them in a .env file and add .env to .gitignore
  2. B.Write them in the README
  3. C.Put them in a comment at the top of the code
  4. 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 →