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

Failure when adding a tracked file in an ignored directory

From
Orgad Shaneh <orgads@gmail.com>
Date
May 13, 2022, 07:10 UTC
Message-ID
<CAGHpTBJDb4rv1EVvR7J9MNEgf0QnFscaf6rWG4_nOW-JnuO9FQ@mail.gmail.com>
Hi,

I have an untracked directory, but inside this directory I have some files that I do want to track. I added these particular files with git add -f, and committed them successfully.

The problem is that every time I update any of these files, I must use git add -f, although the files are already tracked.

Example: $ git init $ mkdir foo $ touch foo/bar $ git add foo/bar $ echo /foo > .gitignore $ git add foo/bar The following paths are ignored by one of your .gitignore files: foo hint: Use -f if you really want to add them. hint: Turn this message off by running hint: "git config advice.addIgnoredFile false"

Is this intentional? I think it should only warn and fail for *newly added* files, but succeed silently for tracked files.

- Orgad
Message 1 of 1 in “Failure when adding a tracked file in an ignored directory”
  1. Orgad ShanehMay 13, 2022

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.