Every time we work in an existing/new project IDE and operating system keep creating multiple files and we need to handle them in every. By using global git ignore file we can globally ignore this and save some time.
Add the global config file in Mac or Linux:
- Fire your terminal
- Run touch ~/.gitignore_global - this will create global .gitignore file in your home directory.
- Add some values that you would like to always ignore.
- Run git config –global core.excludesfile ~/.gitignore_global. According to this page at git-scm.com this command will make all the patterns from ~/.gitignore_global ignored in all situations.