简体   繁体   English

知道忘记或忽视是否更好?

[英]Is it better to hg forget or ignore?

I have some binary files that I don't need to commit. 我有一些我不需要提交的二进制文件。 I need them for local. 我需要他们当地人。 Should I do hg forget binary-folder/ or add this line to .hgignore ? 我应该hg forget binary-folder/或将此行添加到.hgignore吗?

glob:binary-folder/*

Which one is better? 哪一个更好?

Thanks. 谢谢。

The following quote is from this mailing list post by Martin Geisler. 以下引用来自Martin Geisler的邮件列表帖子

A file can be tracked or not, you use 'hg add' to track a file and 'hg remove' or 'hg forget' to un-track it. 可以跟踪或不跟踪文件,使用“hg add”跟踪文件并使用“hg remove”或“hg forget”来取消跟踪。 Using 'hg remove' without flags will both delete the file and un-track it, 'hg forget' will simply un-track it without deleting it. 使用不带标记的'hg remove'将删除文件并取消跟踪它,'hg forget'将简单地取消跟踪它而不删除它。

Un-tracked files show up with a question mark in 'hg status', unless they are matched by the .hgignore file. 未跟踪的文件在“hg status”中显示问号,除非它们与.hgignore文件匹配。 So when you 'hg forget' a file, it will typically show up as un-tracked in 'hg status', unless you have a line in your .hgignore that matches said file. 因此,当您忘记'文件时,它通常会在'hg status'中显示为未跟踪,除非您的.hgignore中有一行与该文件匹配。

Tracked files are never affected by the .hgignore file. 跟踪文件永远不会受.hgignore文件的影响。

For your case, apparently ignore would be preferred. 对于您的情况,显然忽略将是首选。

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

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