如何忽略 json 文件?

How to ignore a json file?

我将 api 密钥保存在 json 文件中。此 json 文件位于主文件夹中。我不想将此密钥文件提交给 github。我应该在 gitignore 文件中添加什么?

我的项目文件如下..

只需将 keys.json 添加到您的 .gitignore 文件中。