问题:
My .gitignore file seems to be being ignored by Git - could the .gitignore file be corrupt? 我的.gitignore文件似乎已被Git忽略.gitignore文件是否已损坏? Which file format, locale or culture does Git expect? Git需要哪种文件格式,语言环境或文化?
My .gitignore : 我的.gitignore :
1# This is a comment 2debug.log 3nbproject/
Output from git status : 从git status输出:
1# On branch master 2# Your branch is ahead of 'origin/master' by 1 commit. 3# 4# Untracked files: 5# (use "git add <file>..." to include in what will be committed) 6# 7# debug.log 8# nbproject/ 9nothing added to commit but untracked files present (use "git add" to track)
I would like debug.log and nbproject/ not to appear in the untracked files list. 我希望debug.log和nbproject/不会出现在未跟踪的文件列表中。
Where should I start looking to fix this? 我应该从哪里着手解决此问题?
解决方案:
参考一: https://stackoom.com/question/m34B/gitignore被Git忽略
参考二: https://oldbug.net/q/m34B/gitignore-is-ignored-by-Git