# How to ignore a modified file?

3 messages from 2009-03-05 to 2009-03-05. Participants: dealmaker, Sverre Rabbelier, Robin Rosenberg.
Thread: https://gitlist.dev/t/18144

## dealmaker, 2009-03-05 08:44

Subject: How to ignore a modified file?
Message-ID: <1236242659559-2428157.post@n2.nabble.com>
URL: https://gitlist.dev/e/1236242659559-2428157.post%40n2.nabble.com

```

Hi, 
  I run "git status", and I saw the a modified file in a directory.  I want
to ignore all files in that directory.  I put the directory name into
.gitignore, but it still shows as modified file.  Why?  How do I ignore the
directory?
Thanks.
-- 
View this message in context: http://n2.nabble.com/How-to-ignore-a-modified-file--tp2428157p2428157.html
Sent from the git mailing list archive at Nabble.com.

```

## Sverre Rabbelier, 2009-03-05 08:50

Subject: Re: How to ignore a modified file?
Message-ID: <fabb9a1e0903050050r322f1c54q8fd704cecc126115@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e0903050050r322f1c54q8fd704cecc126115%40mail.gmail.com
In-Reply-To: <1236242659559-2428157.post@n2.nabble.com>

```
Heya,

On Thu, Mar 5, 2009 at 09:44, dealmaker <vinkhc@gmail.com> wrote:
> [...] How do I ignore [a tracked] directory?

$ git rm -rf --cached dirname && git commit -m "Removed directory from git"

Git will tell you about changes to the contents of the directory until
you stop tracking it. --cached will prevent the folder from actually
being removed from your harddisk.

-- 
Cheers,

Sverre Rabbelier

```

## Robin Rosenberg, 2009-03-05 20:45

Subject: Re: How to ignore a modified file?
Message-ID: <200903052145.08249.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200903052145.08249.robin.rosenberg.lists%40dewire.com
In-Reply-To: <1236242659559-2428157.post@n2.nabble.com>

```
torsdag 05 mars 2009 09:44:19 skrev dealmaker <vinkhc@gmail.com>:
> 
> Hi, 
>   I run "git status", and I saw the a modified file in a directory.  I want
> to ignore all files in that directory.  I put the directory name into
> .gitignore, but it still shows as modified file.  Why?  How do I ignore the
> directory?
> Thanks.

git update-index --assume-unchanged <files...>

-- robin

```
