$ git config --global core.excludesfile ~/.gitignore_global
$ vim ~/.gitignore_global
#配置文件参考如下
# for Mac OS X System Files
.DS_Store
Thumbs.db
# for emacs
*~
[#]*[#]
# for Eclipse
*.project
# for Logs and databases
*.log
# remove SVN
.svn
# for Xcode
.*.swp
.clang_complete
*.xcodeproj/project.xcworkspace/
*.xcodeproj/xcuserdata/
# for IDEA
*/build/*
.idea/*
*.iml
/out/*