I'm having trouble understanding how to use and write to a .gitignore, .git/config file and .git/info/exclude file. 

I've read through [this post](https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally/1753078#1753078) and [this documentation](https://git-scm.com/docs/gitignore) but its just not clicking for me. 

my understanding is that:
- .gitignore is to be used when you are okay with the file being pushed to git hub.  

- use .git/info/exclude to keep files or folders from being pushed to git hub. So this is where you would hid secrets like API keys or put large folders of photos that do not need to be in git hub but just on my machine for deep learning training.  

Is this not accurate?

How can I write to the .gitignore or .git/info/exclude files using command line or git bash? I've attempted many times by experimenting with syntax but am at a loss now. And I also cannot figure out how to open them through jupyter interface.