Skip to contentSkip to conversation

How to ignore a modified file?

DISCUSSION dealmaker 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

dealmaker

author
#0 lore raw

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.

Signature · 2 lines
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.
#1 lore raw

torsdag 05 mars 2009 09:44:19 skrev dealmaker <[email protected]>:

Quoted 7 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

#2 lore raw
In reply to dealmaker

Heya,

Quoted 1 line · dealmaker

[...] 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.

Signature · 3 lines
Cheers,

Sverre Rabbelier