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

Re: git add --ignore-errors doesn't ignore .gitignore errors

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 24, 2012, 19:46 UTC
Message-ID
<xmqqsjfsgbff.fsf@junio.mtv.corp.google.com>
In-Reply-To
<8A31466D-A791-4FF9-BFDC-029C4644ABE7@jetbrains.com>
Kirill Likhodedov <Kirill.Likhodedov@jetbrains.com> writes:
Show 12 quoted lines
> Hi,
>
> git add has '--ignore-errors' parameter which, according to the man entry, allows to continue adding even if one of the files failed to add:
>
>  --ignore-errors
>            If some files could not be added because of errors indexing them, do not abort the
>            operation, but continue adding the others. The command shall still exit with non-zero
>            status. The configuration variable add.ignoreErrors can be set to true to make this
>            the default behaviour.
>
> However, if the error happens because a file is ignored by Git,
> git-add aborts, even if "--ignore-errors" is given:

That sounds like the command is behaving exactly as documented. It detected a user error that attempts to add an ignored path. That is totally different from "the contents of the path failed to be indexed" (perhaps due to background virus checker keeping the file open on broken operating system platform) case, which the option tells it to ignore and continue.

Previous: Kirill Likhodedov
Message 2 of 2 in “git add --ignore-errors doesn't ignore .gitignore errors”
  1. Kirill LikhodedovApr 24, 2012
  2. Junio C HamanoApr 24, 2012

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.