Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 即使忽略未跟踪的文件夹,也会显示该文件夹_Git - Fatal编程技术网

Git 即使忽略未跟踪的文件夹,也会显示该文件夹

Git 即使忽略未跟踪的文件夹,也会显示该文件夹,git,Git,我正在使用git存储库跟踪我的主文件夹。在执行了git status之后,我得到了以下信息: # Untracked files: # (use "git add <file>..." to include in what will be committed) # # workspace/ no changes added to commit (use "git add" and/or "git commit -a") 我不得不添加*/跟踪.vim/plugin中的更改,例

我正在使用git存储库跟踪我的主文件夹。在执行了
git status
之后,我得到了以下信息:

# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   workspace/
no changes added to commit (use "git add" and/or "git commit -a")

我不得不添加
*/
跟踪
.vim/plugin中的更改,例如,正如我所看到的。

您忽略了第一行中的所有内容:'*'

然后用第二行“!*/”来取消目录


瞧,你没有忽略目录

是的,但是我的主文件夹中有更多的目录。为什么文件夹没有显示?我猜要么这些目录已经被git跟踪了,要么它们是空的。是吗?@Kilo是的,git已经在跟踪他们中的一些人。这可能是原因吗???@tirengarfio,您在问题中截取的git状态输出部分是未跟踪文件部分。所以,是的,跟踪的目录不会显示在那里。请特别注意,.gitignore根本不会影响跟踪的文件。没有什么。娜达。您可以手动将一个被忽略的文件添加到索引中(使用git add),从那时起,当对其进行更改时,它将不会被忽略。
*
!*/
!.vim/plugin/*
!.vim/doc/*