user423455
user423455

Reputation: 843

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.

Upvotes: 3

Views: 3491

Answers (1)

nye17
nye17

Reputation: 13357

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.

Upvotes: 8

Related Questions