title: How can I not push my API Keys/Credentials to Github, especially Public Repos
body: <p>I did ask a few devs on how do they ensure that keys and credentials files aren't pushed. They did give me few answers, but I didn't find anything consistent.
  Lets say there is a creds.json file in /config folder. What are the efficient ways to NOT push these credentials to Github.</p>
  
  <p><strong>Few of the answers I found online :</strong></p>
  
  <ul>
  <li>Add them to .gitignore</li>
  <li>Store keys separately inside the host machine or different folder</li>
  <li>Just be cautious</li>
  </ul>
  
  <p><strong>Blogs I read :</strong></p>
  
  <p><a href="https://www.agwa.name/projects/git-crypt/" rel="noreferrer">https://www.agwa.name/projects/git-crypt/</a></p>
  
  <p><a href="https://blog.roundingpegs.com/how-i-avoid-committing-passwords-to-github/" rel="noreferrer">https://blog.roundingpegs.com/how-i-avoid-committing-passwords-to-github/</a></p>
  
  <p>Is there any tool or a more efficient way such that I don't commit my keys accidentally to Github or warn me before I commit?</p>
  
  <p>I would like you to give a summary of all the possible ways in which you can prevent keys from going to github. Examples to support your summary would be great.</p>