git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug Report: Too many untracked files (gitignore)

From
Stefan Beller <sbeller@google.com>
Date
Sep 2, 2016, 23:58 UTC
Message-ID
<CAGZ79kYhV30AuXUKtp3oewMpnEk5vD=HvRUJTTFaEdsacu3tGw@mail.gmail.com>
In-Reply-To
<CAMbP-nS_MM0QXgw183DLQPx1YU1BH8ytKCv86p-JSxzdb2jpQA@mail.gmail.com>
On Fri, Sep 2, 2016 at 4:06 PM, Brian Levinstein <blevinstein@gmail.com> wrote:
Show 17 quoted lines
> The relevant repo is here:
> https://github.com/blevinstein/dotfiles
>
> My gitignore file looks like this:
> https://github.com/blevinstein/dotfiles/blob/2400ca8642a7b454a2bfc54e8402343d008836aa/.gitignore
> It basically ignores all files, except for specifically whitelisted
> files. However, when I run "git status" (git version
> 2.8.0.rc3.226.g39d4020), I see the following untracked files:
>
> #       .bash_history
> #       .bash_logout
> #       .cache/
> #       [private]
> #       [private]
> #       .profile
> #       .viminfo
> #       dev/
For the specific files to be exclued, I'd recommend starting with a slash, e.g.
    !/.bashrc
    !/.vim/colors/*

If the pattern does not contain a slash /, Git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file).

See the notes section of https://git-scm.com/docs/gitignore
So I do not quite see the bug?
Stefan
Previous: Brian LevinsteinNext: Brian Levinstein
Message 2 of 3 in “Bug Report: Too many untracked files (gitignore)”
  1. Brian LevinsteinSep 2, 2016
  2. Stefan BellerSep 2, 2016
  3. Brian LevinsteinSep 3, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.