William
William

Reputation: 443

How can I forget all .DS_STORE files in a Mercurial repository?

I'm working with a Mercurial repository in which .DS_STORE files are checked in. How can I forget those files (from all subdirectories)? I see plenty of responses for Git, but not Mercurial. I'd be immediately ignoring those files soon after, so if there's any way to do both, I'd love to hear about it. Thanks!

Upvotes: 3

Views: 2044

Answers (2)

lxg
lxg

Reputation: 13107

Use .hgignore. The syntax is similar to the one of .gitignore.

https://www.mercurial-scm.org/wiki/.hgignore

Upvotes: 1

Edward
Edward

Reputation: 3276

Once you add the .DS_STORE entry to your .hgignore file, you can then forget all files that meet your ignore files with

hg forget "set:hgignore()" 

Please note: This will delete the files that you are about to forget!

If you want to keep the files and just have them ignored by hg, I would copy the repo locally, forget the files, commit the forgeting, and copy back in those files you need around but not tracked.

.hgignore on its own has no impact on files that are already tracked.

Upvotes: 7

Related Questions