全局配置
-
找到
git
的全局配置文件,一般是在C:\Users\lenovo
下,文件名:.gitconfig
,注:lenovo
是我的用戶名 -
在
.gitconfig
中添加[core]
及以下代碼[user] name = yangzhen email = p7_1994@163.com [credential] helper = manager [core] excludesfile = C:\\Users\\lenovo\\gitignore_global.txt
-
創建
gitignore_global.txt
文件,拷貝如下代碼.idea/* *.iml target/*
項目配置
在git
倉庫創建項目時,會自動生成.gitignore
文件,在這個文件裏指定忽略的內容即可