简体   繁体   English

Mercurial [HG] - 获取.hgignore排除文件的列表

[英]Mercurial [HG] - Get the list of .hgignore excluded files

I use this .hgignore file liberally in my projects, it has proven worthy so far. 我在我的项目中.hgignore使用这个 .hgignore文件,到目前为止它已被证明是值得的。

However, every once in a while I'd like to do a reality check, to make sure it didn't eat up something valuable. 但是,每隔一段时间我就会做一次现实检查,以确保它没有吃掉有价值的东西。

My question is: how can I find out the exact list of excluded files? 我的问题是:我怎样才能找到排除文件的确切列表? (The files that actually match the .hgignore patterns) (实际匹配.hgignore模式的文件)

Answers using TortoiseHg or command-line are welcome. 欢迎使用TortoiseHg或命令行的答案。

命令hg status --ignored (或hg status -i )列出已被忽略的文件。

The answer hit me while I was finishing the question (yet again). 当我完成这个问题时(但又一次),答案就打动了我。

It's trivial, actually: 实际上,它是微不足道的:

  • Start by making sure there are no pending commits. 首先确保没有待处理的提交。 在此输入图像描述

  • (Re)move/rename the .hgignore file (重新)移动/重命名.hgignore文件

  • Hit 'Refresh' in TortoiseHg's commit window. 在TortoiseHg的提交窗口中点击'刷新'。 在此输入图像描述

You'll now get the exact list of ignored files (+ the change to the .hgignore file itself). 您现在将获得被忽略文件的确切列表(+ .hgignore文件本身的更改)。

Rubber ducking at its best. 橡胶躲避最好。 (Hmm, SO should add a badge for this :) (嗯,所以应该为此添加徽章:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM