不知怎的,git得到了它,我有一个未跟踪的文件(一个目录已经在我的存储库中已经有一段时间了,大约17个月).无论如何,我似乎无法说服git这不是一个未经跟踪的文件.此外,我无法重新添加有问题的文件.知道如何解决这个问题吗?
例:
? git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# rosetta_tests/profile/tests/docking/
nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)
我尝试添加目录并重新检查状态.
? git add rosetta_tests/profile/tests/docking/
? git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# rosetta_tests/profile/tests/docking/
nothing added to commit but untracked files present (use "git …Run Code Online (Sandbox Code Playgroud) 在这种情况下,我不确定我的.gitignore文件出了什么问题,但是这些文件一直在显示.
我正在使用Jekyll建立一个博客.Jekyll 在开始服务时生成_site和编目.sass-cache.
我之前提交过这些目录,然后才意识到我想忽略它们.
为了过于谨慎,我向我添加了以下所有内容.gitignore:
##Jekyll
/_site/
_site/
_site
/.sass-cache/
.sass-cache/
.sass-cache
Run Code Online (Sandbox Code Playgroud)
既然我知道我之前提交过这些文件,我:
.gitignore文件.git rm -r --cached ._site和.sass-cache文件夹git add .并git status显示工作目录是干净的尽管如此,更新的.gitignore文件,并验证(我认为?)事情是干净和良好的,每当我运行bundle exec jekyll serve和jekyll生成文件时,我看到.sass-cache并_site显示在我未跟踪的文件中.
可以在此处找到当前状态的.gitignore .