Jonathan Holland
Jonathan Holland

Reputation: 1281

Retroactively remove commonly ignored files from Mercurial?

I started a new project and did a half dozen local commits in Mercurial before I remembered to copy my .hgignore file into the working directory.

So, now I have a bunch of binary and debug symbol files that I'd like to retroactively prune out.

I haven't pushed this project to a remote, so I could just trash the hg folders and start over, that is an option.

However is there some kind of extension to HG that reads .HgIgnore and prunes these files out of the changesets?

Upvotes: 3

Views: 376

Answers (1)

lee-m
lee-m

Reputation: 2267

You could run your repository through the convert extension and use the --filemap option to prune out files and directories that you have ignored in your hgignore file in the converted repository.

That will preserve your history and you'll end up with a "clean" repository to carry on working with.

Upvotes: 5

Related Questions