How to push code to Github hiding the API keys?

后端 未结 4 1588
死守一世寂寞
死守一世寂寞 2020-12-04 22:12

I want to push some codes to my GitHub Repository. These codes are in different languages like Javascript, Java, Python etc. Some of t

4条回答
  •  离开以前
    2020-12-04 22:41

    You should consider using .env files and read the keys from the environmental variables. How to do so depends on the language and tools you use (for node.js, php, etc.).

    You can exclude .env file from commits by adding .env to the .gitignore. You can also upload an example configuration .env.example with dummy data or blanks to show the schema your application requires.

提交回复
热议问题