Skip to content

Instantly share code, notes, and snippets.

@escees
Created April 7, 2021 05:45
Show Gist options
  • Save escees/1a659d1987ab6f32860168d1d6fe135c to your computer and use it in GitHub Desktop.
Save escees/1a659d1987ab6f32860168d1d6fe135c to your computer and use it in GitHub Desktop.
Global .gitignore file for excluding your work environment-specific files

You don't have to add your .idea or .vs_code directories to your .gitignore file every time you start new project.

Make it global.

  1. Create file:
 touch ~/.gitignore
  1. Add what you want to ignore:
  • for Debian/Ubuntu:
.idea or .vs_code or whatever you want :)
  • for Mac:
.DS_Store
.vscode
whatever you want

Configure git to use it:

git config --global core.excludesfile ~/.gitignore

That's it.

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