Skip to contentSkip to conversation

How to ignore a modified file?

DISCUSSION Quim K Holland 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

You can run "git checkout directory".

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

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

Heya,

Quoted 1 line · Quim K Holland

You can run "git checkout directory".

Yes, but that would destroy his changes, I do not get the impression that that's what he wants...

Signature · 3 lines
Cheers,

Sverre Rabbelier
#2 lore raw
Quoted 7 lines · Sverre Rabbelier

Heya,

Quoted 1 line · Quim K Holland

You can run "git checkout directory".

Yes, but that would destroy his changes, I do not get the impression that that's what he wants...

Actually, I thought the advises from you two were both horrible without first qualifying the answers nor asking what was really wanted.

Yours didn't *ignore* changes, but staged (and would result in a later commit) a different change to these paths, namely removal of them.

"I have these changes but I want to ignore" may mean "I didn't mean to change them and do not care about them." and "checkout" may be the right thing to use if that is the case.

#3 lore raw

Heya,

Quoted 2 lines · Junio C Hamano

Yours didn't *ignore* changes, but staged (and would result in a later commit) a different change to these paths, namely removal of them.

You are of course right, thank you for pointing it out.

Signature · 3 lines
Cheers,

Sverre Rabbelier