我的.gitignore文件似乎被Git忽略了- .gitignore文件是否可能损坏?Git需要哪种文件格式,语言环境或文化?
我的.gitignore:
# This is a comment
debug.log
nbproject/
来自的输出git status:
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# debug.log
# nbproject/
nothing added to commit but untracked files present (use "git add" to track)
我想debug.log和nbproject/不会出现在未跟踪文件列表。
我应该从哪里着手解决此问题?
echo "file" > .gitignore在PowerShell 中使用过,文件具有UCS-2编码!
git rm --cached debug.log nbproject/
.gitignore文件使用ANSI或UTF-8编码。如果它使用Unicode BOM,则Git可能无法读取文件。