There's a section at the bottom of the `gitignore` docs (see
https://git-scm.com/docs/gitignore) that deals specifically with this use
case.  It reads:

Example to exclude everything except a specific directory foo/bar (note the
/* - without the slash, the wildcard would also exclude everything within
foo/bar):

    $ cat .gitignore
    # exclude everything except directory foo/bar
    /*
    !/foo
    /foo/*
    !/foo/bar

(Note the use of the `/*` suffix.)


On Tue, Sep 24, 2019 at 3:35 AM Frank Millman <fr...@chagford.com> wrote:

> A section of my .gitignore looks like this
>
>
> aib/html/ !aib/html/src/
>
>
> The intention is to exclude the contents of aib/html/, but include the
> contents of aib/html/src/.
>
>
> git status correctly shows files in aib/html/src/ that have been modified,
> but does not show files that have been added.
>
>
> How can I get it to include new files?
>
>
> Frank Millman
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/git-users/5adeba65-4991-4bf8-93a1-12e22854a3ec%40googlegroups.com
> <https://groups.google.com/d/msgid/git-users/5adeba65-4991-4bf8-93a1-12e22854a3ec%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CADOkX1d84%2Bf7b7FEWXb8pft45Am%2BERYsPswLssr_mrFaUJjsOw%40mail.gmail.com.

Reply via email to