如何在恢复时忽略 hgignore (又名删除所有无用的文件)
我有一个 .hgignore 文件,非常适合隐藏编译 C# 项目时创建的所有文件和目录。
现在,当“恢复”到以前的版本时,我还想清理我的工作目录,即删除我之前编译的所有 exe 和 dll(因为我最终可能会使用错误版本的 exe 或dll 却没有意识到)。
有没有办法做到这一点(某种程度上忽略 .hgignore )?现在我只是删除所有 bin 和 obj 目录,但也许 Hg 也可以做到这一点......
I have a .hgignore file that works great for hiding all the files and directories creating when compiling my C# projects.
Now when doing a "revert" to a previous revision, I would also like to clean up my working directory, ie remove all the exes and dlls that I've previously compiled (as I may end up using the wrong version of an exe or dll without realizing it).
Is there a way to do that (kind of ignoring .hgignore somehow)? Right now I'm just removing all bin and obj directories, but maybe Hg can also do it...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在寻找 purge 扩展程序。
You are looking for the purge extension.
鲁迪的答案是最好的,但如果你不想安装扩展,你总是可以这样做:
它做同样的事情。 (也可以在状态选项中包含
i
来获取被忽略的文件。Rudi's answer is best, but if you don't want to install an extension you can always do:
which does the same thing. (Optionally include
i
in the options for status to get ignored files too.