.gitignore helps me manage my commits by setting which files or directory don’t end in my repository. I know two good practices if you work for example on an open source project:
I follow this practices for all my projects, if you are Mac user you have a DS_STORE files, there is a method for exclude this file of default.
~./.gitconfig is your configuration file, every user has it. If you execute this command
into this file it write thiese lines
/Users/gianarb/.gitignore_global is my global gitignore file!