Re: [BUG] spurious failure when adding tracked file in ignored directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 26.10.24 um 01:30 schrieb Christian Sattler:
> Adding a tracked file in an ignored directory causes a spurious warning and
> exit code 1 failure (despite actually adding the file). Example on 2.47.0:
> 
> git init
> mkdir dir
> touch dir/file
> git add dir/file
> echo dir >.gitignore
> git add dir/file
> 
> The last command fails with exit code 1 and prints:
> 
>> The following paths are ignored by one of your .gitignore files:
>> dir
>> hint: Use -f if you really want to add them.
>> hint: Disable this message with "git config advice.addIgnoredFile false"
> 
> Suppose we change dir/file before the last command.  Then after the last
> command, the change is in the index, despite what the warning indicates.

I cannot reproduce your claim "despite actually adding the file": the
file is not added. So, everything works as intended. What does `git
status` tell after `git add`?

-- Hannes





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux