On Wed, Jan 22, 2014 at 11:50:16AM -0800, Philipp Kraus wrote:
> Hello,
> 
> I have defined a gitignore with file pattern, which should be ignored eg:
> *.tmp
> *.bak
> ...
> 
> I would change the gitignore file to:
> .*
> !*.cpp
> !*.res
> 
> but I would also removed tracked files, which are added to the repo if the 
> files does not match the ignore pattern.
> I would like to check the current files after changing the gitignore which 
> will not be matched and after that I will
> remove them from the repo
> 
> How can I do this

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.

/M

-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe               http://therning.org/magnus

Most software today is very much like an Egyptian pyramid with
millions of bricks piled on top of each other, with no structural
integrity, but just done by brute force and thousands of slaves.
     -- Alan Kay

Attachment: signature.asc
Description: Digital signature

Reply via email to