Tuesday, 1 October 2013

git ignore specific directories exception

git ignore specific directories exception

I have source structure similar to this one:
Project A
bin
src
...
Prjoject B
bin
src
...
...
and I need to ignore everything except content of src folders. There are
many other projects, and I don't want to put all of them into .gitignore.
Sometimes I need to add another project into this structure, so everytime
I add project, I would have to add it to gitignore...
So far I've been using * in .gitignore and manually adding files to be
indexed using git add -f, but it is very slow method and sometimes I might
miss something. And not seeing new files in git status is also very
uncomfortable.
Is it possible to use something like this?
*
! */src/*
(I tried this one with several other variations, but it didn't work. I
also tried using **.)
P.S: I'm currently using git 1.7.1

No comments:

Post a Comment