Gitignore不忽略文件夹 [英] Gitignore not ignoring folders
问题描述
我已将多个文件夹添加到我的.gitignore
文件中,但是当我执行git status
时它们仍然出现.
I have added multiple folders to my .gitignore
files, but they still appear when I do git status
.
我的安装/计算机是新的,我正在尝试在svn目录中初始化一个git存储库.
My installation/computer is new, and I'm trying to init a git repository inside a svn one.
正如我之前做过数百次(虽然不在这台计算机上)一样,标记为已忽略的文件夹(尤其是根目录下的.svn
文件夹,以及src/www
中的bin
和obj
)应该在执行git status
时不会出现,并且在执行git add .
时不应添加它们,但是会添加.
As I've done hundreds of times before (not on this machine though), the folders marked as ignored (notably the .svn
folder at the root, and bin
and obj
inside src/www
) should not appear when doing git status
, and they should not be added when doing git add .
, but they do.
D:\ DEV>更多.gitignore
.svn/
[Bb] in/
[oo] bj/
包/
D:\DEV> more .gitignore
.svn/
[Bb]in/
[Oo]bj/
packages/
D:\ DEV> git状态
在分支母版上
未跟踪的文件:
(使用"git add ..."将要提交的内容包括在内)
D:\DEV> git status
On branch master
Untracked files:
(use "git add ..." to include in what will be committed)
.svn/
src/UI.Admin.Tests/obj/
src/packages/
src/www/bin/
src/www/obj/
未添加任何内容来提交但存在未跟踪的文件(使用"git add" 跟踪)
nothing added to commit but untracked files present (use "git add" to track)
推荐答案
我找到了答案(但是我不确定问题的根源是什么.)
I have found an answer (but I'm not sure what's the source of the problem).
我已经删除了.gitignore
文件,并使用touch .gitignore
重新创建了它.
I have deleted the .gitignore
file and recreated it using touch .gitignore
.
我已经从某个网站复制/粘贴了原始文件的内容,我认为这与编码或类似内容有关.
I had copy/pasted the original file content from some website, I'm assuming it has something to do with the encoding or something like this.
这篇关于Gitignore不忽略文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!