My gitignore_global is not working even though gitconfig specify the absolute path
<p>I created a .gitignore_global file in <code>~/Users/Tony/.gitignore_global</code>, which is also the path where the <code>.gitconfig</code> is stored.</p>

<p>This is what is inside the <code>.gitconfig</code>:</p>

<pre><code>[core]
    excludesfile = ~/.gitignore_global
</code></pre>

<p>This is what is inside the <code>.gitignore_global</code>:</p>

<pre><code># 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

# CocoaPods #
#############
Pods

# SVN #
#######
*.svn
.svn/*

# Xcode #
#########
build/
DerivedData
profile
xcuserdata
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
*.mode1
*.mode1v3
*.mode2v3
*.moved-aside
*~.nib
*.pbxuser
*.perspective
*.perspectivev3
*.swp
*.xccheckout
</code></pre>

<p>I do not understand why the <code>.gitignore_global</code> file isn't working. The <code>.DS_Store</code> files are still being detected by git.<br>
I had already tried comments like "<code>git rm --cached .DS_Store</code>" and tried others solutions found on Stack Overflow, however git is still detecting the <code>.DS_Store</code> files.</p>