# info/exclude not working

3 messages from 2013-06-03 to 2013-06-03. Participants: Devin Rhode, Jeff King.
Thread: https://gitlist.dev/t/34018

## Devin Rhode, 2013-06-03 20:04

Subject: info/exclude not working
Message-ID: <CALy29pLQ-LWg0knzbzLoQfwSt+df_b3tNdWk7OeSN-CjkJhfsQ@mail.gmail.com>
URL: https://gitlist.dev/e/CALy29pLQ-LWg0knzbzLoQfwSt%2Bdf_b3tNdWk7OeSN-CjkJhfsQ%40mail.gmail.com

```
For some reason info/exclude hasn't been working for me. I have a
pretty plain macbook pro, with a slow standard hard drive, running the
latest mac os 10.7 lion

MBP:dish devin$ pwd
/Users/devin/Dropbox/ads-G2/dish

MBP:dish devin$ cat ../.git/info/exclude
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
models/CAFE.json
dish/models/CAFE.json

MBP:dish devin$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified:   models/CAFE.json ***Shouldn't appear
# modified:   page_0.ejs
# modified:   page_0.xml
# modified:   page_1.ejs
# modified:   page_1.xml
#
no changes added to commit (use "git add" and/or "git commit -a")

```

## Jeff King, 2013-06-03 20:32

Subject: Re: info/exclude not working
Message-ID: <20130603203226.GA23224@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20130603203226.GA23224%40sigill.intra.peff.net
In-Reply-To: <CALy29pLQ-LWg0knzbzLoQfwSt+df_b3tNdWk7OeSN-CjkJhfsQ@mail.gmail.com>

```
On Mon, Jun 03, 2013 at 01:04:39PM -0700, Devin Rhode wrote:

> MBP:dish devin$ cat ../.git/info/exclude
> # git ls-files --others --exclude-from=.git/info/exclude
> # Lines that start with '#' are comments.
> # For a project mostly in C, the following would be a good set of
> # exclude patterns (uncomment them if you want to use them):
> # *.[oa]
> # *~
> models/CAFE.json
> dish/models/CAFE.json
> 
> MBP:dish devin$ git status
> # On branch master
> # Changes not staged for commit:
> #   (use "git add <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working directory)
> #
> # modified:   models/CAFE.json ***Shouldn't appear

The exclude mechanism does not mean "do not ever look at this file". It
means "when you are adding untracked files, do not include this one".
Somebody has already added the file to the repository before your
exclude was in place, so it is a tracked file.

There is currently no official mechanism in git to do what you want
(there are some hacks, but they include many pitfalls).

-Peff

```

## Devin Rhode, 2013-06-03 20:44

Subject: Re: info/exclude not working
Message-ID: <CALy29p+pdXSLmMOGcJ+YcWe4TDDUsE3=Shg=jNp-=Nhw+OkORg@mail.gmail.com>
URL: https://gitlist.dev/e/CALy29p%2BpdXSLmMOGcJ%2BYcWe4TDDUsE3%3DShg%3DjNp-%3DNhw%2BOkORg%40mail.gmail.com
In-Reply-To: <20130603203226.GA23224@sigill.intra.peff.net>

```
I wouldn't worry too much about this use case, we have a pretty lame workflow

On Mon, Jun 3, 2013 at 1:32 PM, Jeff King <peff@peff.net> wrote:
> On Mon, Jun 03, 2013 at 01:04:39PM -0700, Devin Rhode wrote:
>
>> MBP:dish devin$ cat ../.git/info/exclude
>> # git ls-files --others --exclude-from=.git/info/exclude
>> # Lines that start with '#' are comments.
>> # For a project mostly in C, the following would be a good set of
>> # exclude patterns (uncomment them if you want to use them):
>> # *.[oa]
>> # *~
>> models/CAFE.json
>> dish/models/CAFE.json
>>
>> MBP:dish devin$ git status
>> # On branch master
>> # Changes not staged for commit:
>> #   (use "git add <file>..." to update what will be committed)
>> #   (use "git checkout -- <file>..." to discard changes in working directory)
>> #
>> # modified:   models/CAFE.json ***Shouldn't appear
>
> The exclude mechanism does not mean "do not ever look at this file". It
> means "when you are adding untracked files, do not include this one".
> Somebody has already added the file to the repository before your
> exclude was in place, so it is a tracked file.
>
> There is currently no official mechanism in git to do what you want
> (there are some hacks, but they include many pitfalls).
>
> -Peff
>
>

```
