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

Explicitly adding ignored files in subdirectories not working

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
Feb 23, 2010, 21:07 UTC
Message-ID
<fabb9a1e1002231307o2c3499e6k3f1026f71a544b16@mail.gmail.com>
Heya,

I've been bitten by this before, is this behavior intentional? We don't even warn that the user's action was ignored; at the very least we should do that. The current behavior is just frustrating.

sverre@laptop-sverre:~/code$ git init ignoretest
Initialized empty Git repository in /home/sverre/code/ignoretest/.git/
sverre@laptop-sverre:~/code$ cd ignoretest/
sverre@laptop-sverre:~/code/ignoretest$ mkdir subdir
sverre@laptop-sverre:~/code/ignoretest$ echo "hi" >> subdir/a.txt
sverre@laptop-sverre:~/code/ignoretest$ echo "subdir" >> .gitignore
sverre@laptop-sverre:~/code/ignoretest$ git add .gitignore
sverre@laptop-sverre:~/code/ignoretest$ git commit -m "set up ignore"
[master (root-commit) 5a5a614] set up ignore
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
sverre@laptop-sverre:~/code/ignoretest$ git add subdir/a.txt
sverre@laptop-sverre:~/code/ignoretest$ git status
# On branch master
nothing to commit (working directory clean)
-- 
Cheers,

Sverre Rabbelier
Next: Johannes Schindelin
Message 1 of 8 in “Explicitly adding ignored files in subdirectories not working”
  1. Sverre RabbelierFeb 23, 2010
  2. Johannes SchindelinFeb 23, 2010
  3. Sverre RabbelierFeb 23, 2010
  4. Johannes SchindelinFeb 23, 2010
  5. Jeff KingFeb 24, 2010
  6. Sverre RabbelierFeb 27, 2010
  7. Junio C HamanoFeb 27, 2010
  8. Sverre RabbelierFeb 27, 2010

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.