srsarkar7
srsarkar7

Reputation: 155

Adding a node.js config file to .gitignore

This is a very basic question probably, but I cannot figure out how to use .gitignore to ignore a file during commits.

I am creating a Twitterbot in Node.js and have a config.js file with all my API keys. That's all I want to hide.

Do I just make a file called ".gitignore" and type out the name of the file (in this case, "config.js") and save it in my repo?

I'm a total newbie so thanks for any and all help!

Upvotes: 0

Views: 4351

Answers (1)

whatoncewaslost
whatoncewaslost

Reputation: 2256

Yup, that's exactly what you do.

--MyDirectory
----.gitignore
----myconfig.js
----MyFolder1

Then create a .gitignore file and within it, just write

myconfig.js

Upvotes: 2

Related Questions