Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.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
Mercurial如何忽略包含已添加到源代码管理的文件的子文件夹_Mercurial - Fatal编程技术网

Mercurial如何忽略包含已添加到源代码管理的文件的子文件夹

Mercurial如何忽略包含已添加到源代码管理的文件的子文件夹,mercurial,Mercurial,我有一个以下结构的项目 project_dir/ WebContent/ es5/ ... src/ ... .hgignore 我尝试使用以下模式忽略WebContent/es5目录下的所有内容: syntax: glob WebContent/es5/** 或 或 但仍在跟踪文件夹中修改的文件。有人能帮我吗?忽略文件的提示如下: Mercurial系统在根目录中使用名为.hgignore的文件 存储库的目录,以控制其搜索时的行为 当前未跟踪的文件 如

我有一个以下结构的项目

project_dir/
  WebContent/
    es5/
    ...
  src/ 
  ...
  .hgignore  
我尝试使用以下模式忽略
WebContent/es5
目录下的所有内容:

syntax: glob
WebContent/es5/**

但仍在跟踪文件夹中修改的文件。有人能帮我吗?

忽略文件的提示如下:

Mercurial系统在根目录中使用名为.hgignore的文件 存储库的目录,以控制其搜索时的行为 当前未跟踪的文件

如果您已将子目录中的文件添加到repo(明确地或在将模式添加到
.hgignore
文件之前)
mercurial
将记住它,直到您忘记它为止

% hg init foo

% cd foo

% ls

% mkdir sub

% cat <<EOF > .hgignore
^sub/
EOF

% touch a

% touch sub/b sub/c

% hg st
? .hgignore
? a

% hg add sub/b

% hg st
A sub/b
? .hgignore
? a

% hg forget sub
removing sub/b

% hg st
? .hgignore
? a
忽略文件的提示如下所示:

Mercurial系统在根目录中使用名为.hgignore的文件 存储库的目录,以控制其搜索时的行为 当前未跟踪的文件

如果您已将子目录中的文件添加到repo(明确地或在将模式添加到
.hgignore
文件之前)
mercurial
将记住它,直到您忘记它为止

% hg init foo

% cd foo

% ls

% mkdir sub

% cat <<EOF > .hgignore
^sub/
EOF

% touch a

% touch sub/b sub/c

% hg st
? .hgignore
? a

% hg add sub/b

% hg st
A sub/b
? .hgignore
? a

% hg forget sub
removing sub/b

% hg st
? .hgignore
? a

请再次尝试您的第一个glob示例,但如果最后没有**,则应该可以使用它。@Nanherin不幸的是,它对我没有帮助。WebContent/es5/中的文件。。您的第一个glob示例仍然标记为modifiedTry,但如果最后没有**,则应该可以使用它。@Nanhydrin不幸的是,它没有帮助我。WebContent/es5/中的文件。。仍然标记为修改过的标记很多!它帮助我解决了这个问题。因此,作为结论:正如@nanhyron所建议的,上面的模式应该是:syntax:glob-WebContent/es5/以及上面描述的其他模式,非常感谢!它帮助我解决了这个问题。因此,作为结论:如上所述的as@nanhydron模式应该是:syntax:glob-WebContent/es5/,其余部分如上所述
% hg init foo

% cd foo

% ls

% mkdir sub

% cat <<EOF > .hgignore
^sub/
EOF

% touch a

% touch sub/b sub/c

% hg st
? .hgignore
? a

% hg add sub/b

% hg st
A sub/b
? .hgignore
? a

% hg forget sub
removing sub/b

% hg st
? .hgignore
? a
   - forget files that would be excluded by .hgignore:

        hg forget "set:hgignore()"