Skip to content

Instantly share code, notes, and snippets.

@denzildoyle
Last active August 29, 2015 14:13
Show Gist options
  • Save denzildoyle/3e3ab96f2cb72c6fad71 to your computer and use it in GitHub Desktop.
Save denzildoyle/3e3ab96f2cb72c6fad71 to your computer and use it in GitHub Desktop.
Globally ignore these files from all the git repos on your system.

Follow the instrustions below to create a global git ignore file:

    vi ~/.gitignore_global  

Adding Rules for ignoring files like:

    # Compiled source #  
    ###################  
    *.com  
    *.class  
    *.dll  
    *.exe 
    *.o  
    *.so  
      
    # Packages #  
    ############  
    # it's better to unpack these files and commit the raw source  
    # git has its own built in compression methods  
    *.7z  
    *.dmg  
    *.gz  
    *.iso  
    *.jar  
    *.rar  
    *.tar  
    *.zip  
      
    # Logs and databases #  
    ######################  
    *.log  
    *.sql  
    *.sqlite  
      
    # OS generated files #  
    ######################  
    .DS_Store  
    .DS_Store?  
    ._*  
    .Spotlight-V100  
    .Trashes  
    ehthumbs.db  
    Thumbs.db  

Now, add this file to your global git config:

    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