简体   繁体   中英

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 ?

glob:binary-folder/*

Which one is better?

Thanks.

The following quote is from this mailing list post by 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. Using 'hg remove' without flags will both delete the file and un-track it, 'hg forget' will simply un-track it without deleting it.

Un-tracked files show up with a question mark in 'hg status', unless they are matched by the .hgignore file. 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.

Tracked files are never affected by the .hgignore file.

For your case, apparently ignore would be preferred.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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