On Friday, January 31, 2014 7:36:52 AM UTC+1, Philipp Kraus wrote:
>
> Hello,
> sorry for the late answer.
>
> Am Mittwoch, 22. Januar 2014 21:27:18 UTC+1 schrieb Magnus Therning:
>>
>> I'm not 100% sure I understand what you wish to do, but you might want 
>> to look at `git clean`.  By default it just lists the files it would 
>> delete, you have to pass it '-f' to actually remove stuff.  You can 
>> also control whether you want it to deal with ignored files or not. 
>>
>
> I'm using gitignore like a black list, so my git ignore defines all files 
> which are not allowed.
> If I switch this to a white list, I need a check if everything is all 
> right. git clean works only
> with untracked files, but in my case I have got tracked files, which can 
> be after the gitignore
> changing also ignored. 
> Did you have got an idea, in which way I can change my gitignores, so that 
> I do not forget some files?
>

So, you want to change .gitignore
and then see which already checked-in files would have been ignored had 
they not been added already..

Well.. Here's a pragmatic approach:

cd repo
mv .git .. # move .git somewhere else temporarily
git init
git status --ignored # behold, all ignored files!
rm -r .git
mv ../.git . #revert to old state

If you don't want to toss your .git dir around, you can achieve the same by 
using the GIT_DIR variable:

cd repo
git --git-dir /tmp/foo.git init #just init an empty repo somewhere
git --git-dir /tmp/foo.git --work-tree . status --ignored  

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to