I have a global .gitignore but files aren't being ignored, why?

13,866

The gitignore man page doesn't mention of a global gitignore file.
Only of the global config core.excludesfile

But if the latter doesn't work, that might be because those files were previously added to the Git repo, in which case you must rm them.

git rm -r --cached .idea

See ".gitignore file not ignoring"

Share:
13,866

Related videos on Youtube

Michael Durrant
Author by

Michael Durrant

Updated on September 18, 2022

Comments

  • Michael Durrant
    Michael Durrant over 1 year

    I have a .gitignore_global in my home directory

    durrantm.../durrantm$ pwd
    /home/durrantm
    durrantm.../durrantm$ ls .git*
    .gitconfig  .gitignore_global
    

    The .gitignore_global has:

    durrantm.../durrantm$ head .gitignore_global
    # RubyMine #
    .idea/
    
    # Compiled source #
    ###################
    *.dll
    *.exe
    
    # Logs and databases #
    ######################
    

    but when I git status for a project I still end up getting the .idea files when I start using rubyMine.

    So my git status still shows this:

    #   modified:   .idea/dataSources.xml
    #   modified:   .idea/linker.iml
    #   modified:   .idea/misc.xml
    #   modified:   .idea/workspace.xml
    

    I have run git config --global core.excludesfile ~/.gitignore_global bvut it didn't help.