Git Ignore (global)

Create the file ~/.gitignore as shown below to not track files that are almost always ignored in all Git repositories.

  1. # Folder view configuration files
  2. .DS_Store
  3. Desktop.ini
  4. # Thumbnail cache files
  5. ._*
  6. Thumbs.db
  7. # Files that might appear on external disks
  8. .Spotlight-V100
  9. .Trashes
  10. # Compiled Python files
  11. *.pyc
  12. # Compiled C++ files
  13. *.out
  14. # Application specific files
  15. venv
  16. node_modules
  17. .sass-cache

Or simply download macOS specific .gitignore maintained by GitHub itself and put contents of it to ~/.gitignore.

Note: You can also download it using curl

  1. curl https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore -o ~/.gitignore