Skip to content

Instantly share code, notes, and snippets.

@devdrops
Last active June 7, 2017 13:25
Show Gist options
  • Select an option

  • Save devdrops/9dcf4f833b6f0a1014a5 to your computer and use it in GitHub Desktop.

Select an option

Save devdrops/9dcf4f833b6f0a1014a5 to your computer and use it in GitHub Desktop.
Basic rules for a good .gitignore file

Basic rules for a good .gitignore file

Remember to include all that nasty files from your OS and tools that you use every day, and be happy to avoid putting more crap in your project's .gitignore file! :D

  • .gitignore_global

    curl -o ~/.gitignore_global https://gist.githubusercontent.com/devdrops/9dcf4f833b6f0a1014a5/raw/22c1021ec116f48b4e30a222db04da55e7be0d0b/gitignore_global.sample
    

Then add it to your git settings:

  • Mac/Linux:

    git config --global core.excludesfile '~/.gitignore_global'
    
  • Windows:

    git config --global core.excludesfile "%USERPROFILE%\.gitignore_global"
    

Tips from http://islegend.com/development/setting-global-gitignore-mac-windows/

# .gitignore_global
######
# OS
.DS_Store
Thumbs.db
######
######
# IDE
nbproject
.idea
.swp
*.swp
.floo
.flooignore
######
######
# PHP
composer.phar
vendor
######
######
# Python
*.pyc
######
######
# Java
*.class
######
######
# Git
!.gitkeep
######
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment