Smrita
Smrita

Reputation: 1279

How do I ignore files in mercurial which has already been tracked?

So what I really wish to do is to ignore some files that have already been added committed and pushed in the repository in mercurial .I have a project with the following directory structure.

Project X
    Project X a
       bin
       res
       src
       .hg
       .hgignore

Now all the files in the Project X has been tracked by mercurial . Now I want to ignore /bin and /res folder

Here is my glob syntax to ignore these directories in .hgignore file.

syntax: glob

/bin
/gen

Also i executed the following command to tell mercurial to forget the previously tracked unwanted files

hg forget /bin
hg forget /res

However mercurial still is tracking both of these folders.I am sort of lost here.Any suggestion would be appreciated.

Upvotes: 1

Views: 361

Answers (1)

Christophe Muller
Christophe Muller

Reputation: 5110

You are right: the easiest way is to tell Mercurial to forget the files (by using hg forget).

However Mercurial is not tracking directories, only files. You cannot add a directory and thus cannot forget it either. You probably have files under bin and res that have been added to the list of tracked files: those are the ones you need to forget.

Upvotes: 2

Related Questions