How to ignore files and folder globally in git?

The Coders Blog
Written by The Coders Blog on
How to ignore files and folder globally in git?

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:

  1. Fire your terminal
  2. Run touch ~/.gitignore_global - this will create global .gitignore file in your home directory.
  3. Add some values that you would like to always ignore. 
  4. 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.

Done !!

The Coders Blog

The Coders Blog

The blog is about ideas & thoughts learned, received & experienced about the coding, programming, problem-solving, software project management and anything undeniably interesting.

Comments

comments powered by Disqus