增加全局 gitignore 配置

  1. 命令行执行:

git config --global core.excludesfile "$HOME/.gitignore"

  1. 家目录增加 .gitignore 文件

  2. .gitignore文件尾末添加

.*

.DS_Store
.gradletasknamecache


!.keep
!.gitignore
!.editorconfig
!.eslintrc
!.babelrc

# node
node_modules
bower_components

# ms doc/xls
~$*.docx
~$*.doc
~$*.xls
~$*.xlsx
~$*.ppt
~$*.pptx

# logs
log
*.log

#idea, mac
.idea
.DS_Store
*.iml
*.ipr
*.iws
*.class
target
out
build
classes

# py
*.pyc

# logfile
*.log
*.log.zip
yarn-error.log

# office
~$*

# backup files
projectFilesBackup

#local files
*.bak
*.local

你可能感兴趣的:(增加全局 gitignore 配置)