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

bug with git add and .gitignore

From
Orgad Shaneh <orgads@gmail.com>
Date
May 10, 2017, 13:44 UTC
Message-ID
<CAGHpTBLGwGXZk=xAB+Pb4GvtqN8+K=8BuaA-zov9sZZat-OYHQ@mail.gmail.com>
Hi,

When a not-ignored file inside an ignore directory is added along with other files, a false alarm is shown:

git init echo /d/ > .gitignore mkdir d touch d/file foo git add -f d/file foo git add d/file # fine git add d/file foo # The following paths are ignored by one of your .gitignore files: # d # Use -f if you really want to add them.

I did not try to add a new file in d. It's the same file that is already indexed.

- Orgad
Next: Samuel Lijin
Message 1 of 2 in “bug with git add and .gitignore”
  1. Orgad ShanehMay 10, 2017
  2. Samuel LijinMay 16, 2017

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.