我在~/.gitignore
中有以下一行(vim特有的规则):
[._]*.s[a-w][a-z]
应用的本地.gitignore
。
git status -u
打印以下内容:
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore.swp
我确实没有将.gitignore.swp
添加到跟踪文件中,因为我不想这样做!
如果我将[._]*.s[a-w][a-z]
行添加到本地(项目)文件夹,则git status -u
输出:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
预计会发生什么(我跟踪.gitignore
),但请注意临时的vim文件会被忽略,因为la
仍会打印它。
由于我与其他人合作处理了许多项目,因此我不想拖动特定于我的工作流程的规则。
我可以将.gitignore
放在一个会影响我的用户正在进行的所有项目的地方吗?
答案 0 :(得分:0)
将其作为~/.config/git/ignore