smeeb
smeeb

Reputation: 29497

How to get changes to .hgignore honored in remote repo

I recently pushed some changes to a Mercurial repo (the remote server) and realized my .hgignore was misconfigured, as certain files (binaries, etc.) were included in the commit/push which should have bee ignored.

So I tweaked my .hgignore and got it perfect, and then push that change. To my surprise, the remote server's web ui (RhodeCode) still shows the "bad" files as belonging to the repo. I would have expected them to be automagically culled out since they violate the .hgignore.

So it looks like I need to do some magic locally that makes my working copy honor the ignore changes, and then push those changes. Perhaps remove the files from tracking?

As a concrete example, in my repo root I have myapp-meta.bin. So in .hgignore I added an entry for *.bin. What exact commands would I need to do in order to remove *.bin from tracking (but not the file system!) and so they don't show up in the latest/head version on the remote repo?

Also, does hg have anything similar to Git's dry run (git add . -n)? Would be handy in the future to see what would be added to tracking before I actually go ahead and do it!

Upvotes: 0

Views: 140

Answers (1)

Paul
Paul

Reputation: 13238

You already added myapp-meta.bin, so it's tracked despite you added it later to .hgignore. If you delete it from the repo it won't be shown as a new file and will be ignored.

As for dry run, many commands (and hg add is among them) support -n or --dry-run option.

Upvotes: 3

Related Questions