threads / discuss / 18144

How to ignore a modified file?

Subject: How to ignore a modified file?

## tl;dr

3 messages between Mar 5, 2009 and Mar 5, 2009.

replies: 2people: 3as markdown or json

dealmaker· Mar 5, 2009, 08:44 UTC · lore
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· Mar 5, 2009, 08:50 UTC · re: dealmaker · lore

Re: How to ignore a modified file?

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· Mar 5, 2009, 20:45 UTC · re: dealmaker · lore

Re: How to ignore a modified file?

torsdag 05 mars 2009 09:44:19 skrev dealmaker <vinkhc@gmail.com>:
Show 7 quoted lines
> 
> 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

← back to recent threads