git-gitignore

mac环境:

//创建gitignore_global文件这个是用来所需要配置的文件
touch ~/.gitignore_global

//使用vim打开gitignore_global
vim ~/.gitignore_global

-

# IntelliJ project files
.idea/*
*.iml
out
gen### Go template
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

写入git的配置文件里:

//$HOME/.gitconfig就是gitconfig的路径的
git config --global core.excludesfile $HOME/.gitignore_global

查看是否成功:

git config --list
credential.helper=osxkeychain
user.name=zwgg
user.email=z***5@126.com
core.excludesfile=/Users/zhu/.gitignore_global
原文地址:https://www.cnblogs.com/zhzhlong/p/9707828.html