Skip to content

Instantly share code, notes, and snippets.

@daffl
Created April 2, 2015 02:43
Show Gist options
  • Select an option

  • Save daffl/ead07a25b4c270c87e77 to your computer and use it in GitHub Desktop.

Select an option

Save daffl/ead07a25b4c270c87e77 to your computer and use it in GitHub Desktop.
Global .gitignore

There are files that should not be included in Git repositories (like IDE settings, OS generated files, temporary files etc.). Instead of adding them to the .gitignore file for each repository over again you can use a global .gitignore file:

Create a .gitignore_global file in your home directory (subl ~/.gitignore_global) with the following content:

# OS files
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

# IDEs
.idea
.workspace
.metadata

# Node
node_modules
npm-debug.log

# Package managers
bower_components

Then run git config --global core.excludesfile ~/.gitignore_global.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment