HOW-TO: Create a global git ignore file

Git Logo

If you work on web projects day in and day out, you might want to make sure pesky cruft files don't get accidentally commited when you push code upstream.

A great way to achieve this goal is to create a global git ignore file. To do this, first configure git to read this global git ignore file (you can name it what you want)

$ git config --global core.excludesfile ~/.gitignore_global

Then edit the ~/.gitignore_global file and add a few ignore lines:

$ vim ~/.gitignore_global

Here's what I recommend:

# Packages 


# Logs and databases


# OS generated files


# Ignore configuration files that may contain sensitive information.

# Ignore paths that contain generated content.


# Ignore default text files

# Ignore everything but the "sites" folder ( for non core developer )


Rob Montero

Rob Montero, Drupal Association Individual Member

Roberto Montero Ortiz is an individual member of the Drupal Association, which fosters and supports the Drupal software project, the community and its growth. He also has an active role in the Drupal Community in Costa Rica and regularly contributes to Drupal Camps held in Latin America.

Rob Montero, Acquia Certified Developer 2014   Rob Montero, Certified Developer Back End Specialist 2015Rob Montero, Acquia Certified Developer Front End Specialist

Rob is also an Acquia Certified Developer, awarded with the Grand Masters title after completing his third certification within a year. 

Zend also certifies Rob's knowledge of PHP OOP skills, but at this point this block is getting a bit presumptious. Suffice it to say, Rob is competitive and competent. He's also a nice guy all around.

Drupal Latin America

Rob Montero is a proud sponsor and mentor of young Drupal talent of the Costa Rican Drupal Users Group and entrepreneur at Drupal Latin America


Get in touch

  • Rob Montero
    Ave Popocatepetl 435 B 504
    Sta Cruz Atoyac, Benito Juarez
    Ciudad de México, 03310 
  • (858) 952 0762
Signup to our newsletter: