git: ignore everything except subdirectory

Posted by Michael Goerz on Stack Overflow See other posts from Stack Overflow or by Michael Goerz
Published on 2009-08-08T11:04:39Z Indexed on 2010/06/09 14:32 UTC
Read the original article Hit count: 268

Filed under:
|

I want to ignore all files in my repository except those that occur in the 'bin' subdirectory. I tried adding the following to my .gitignore

*
!bin/*

This does not have the desired effect, however: I created a new file inside of bin/, but doing 'git status' still "shows nothing to commit (working directory clean)"

Any suggestions?

Thanks, Michael

© Stack Overflow or respective owner

Related posts about git

Related posts about gitignore