threads / discuss / 51628

Git add claims path is ignored, but git check-ignore returns no results

Subject: Git add claims path is ignored, but git check-ignore returns no results

## tl;dr

3 messages between Aug 12, 2019 and Aug 12, 2019.

replies: 2people: 2as markdown or json

geoffsimons@aim.com· Aug 12, 2019, 16:24 UTC · lore
Hi,

I’m struggling with this. Adding a renamed file to git claims that it is ignored, but git check-ignore returns no results. I can’t find anything relevant in .git/info/exclude either, or any of the .gitignore files I could find.

git check-ignore .\Source\UI\Website\LiveFeeds\Releases\IO\ReleasesSerializer.cs git add .\Source\ui\Website\LiveFeeds\Releases\io\ReleasesSerializer.cs The following paths are ignored by one of your .gitignore files: Source/ui/Website/LiveFeeds/Releases/io/ReleasesSerializer.cs Use -f if you really want to add them.

I get a similar result for adding files in that directory, or the parent directory (releases), but the grandparent directory (livefeeds) works fine.  Any ideas what might be causing this?
Regards,
Geoff
Jeff King· Aug 12, 2019, 16:35 UTC · re: geoffsimons@aim.com · lore

Re: Git add claims path is ignored, but git check-ignore returns no results

On Mon, Aug 12, 2019 at 04:24:59PM +0000, geoffsimons@aim.com wrote:
Show 12 quoted lines
> I can’t find anything relevant in .git/info/exclude either, or any of
> the .gitignore files I could find.
> 
> git check-ignore .\Source\UI\Website\LiveFeeds\Releases\IO\ReleasesSerializer.cs
> git add .\Source\ui\Website\LiveFeeds\Releases\io\ReleasesSerializer.cs
> The following paths are ignored by one of your .gitignore files:
> Source/ui/Website/LiveFeeds/Releases/io/ReleasesSerializer.cs
> Use -f if you really want to add them.
> 
> I get a similar result for adding files in that directory, or the
> parent directory (releases), but the grandparent directory (livefeeds)
> works fine.  Any ideas what might be causing this?

I notice that your "add" and "check-ignore" commands differ in the case of "UI". I think both commands should work correctly when on a case-insensitive filesystem (and a few checks I did after setting core.ignorecase manually seem to confirm this).

But maybe try it with "ui" in the check-ignore command and see if that changes anything?

Another thing I notice is that you're using Windows-style back-slashes for the path separators (whereas internally in Git, everything is front-slashes). AFAIK that's supposed to work everywhere on Windows, but I wouldn't be surprised if there are corner cases where it doesn't. Does switching to:

  git check-ignore ./Source/ui/Website/LiveFeeds/Releases/IO/ReleasesSerializer.cs
help?
-Peff
geoffsimons@aim.com· Aug 12, 2019, 16:50 UTC · re: Jeff King · lore

Re: Git add claims path is ignored, but git check-ignore returns no results

Hi Peff,
Thanks, I didn't think that would make any difference either, but changing the case resolved it! I'm now able to find the relevant line in the .gitignore file.
Regards,
Geoff
-----Original Message-----
From: Jeff King <peff@peff.net>
To: geoffsimons <geoffsimons@aim.com>
CC: git <git@vger.kernel.org>
Sent: Mon, 12 Aug 2019 17:35
Subject: Re: Git add claims path is ignored, but git check-ignore returns no results
On Mon, Aug 12, 2019 at 04:24:59PM +0000, geoffsimons@aim.com wrote:
Show 12 quoted lines
> I can’t find anything relevant in .git/info/exclude either, or any of
> the .gitignore files I could find.
> 
> git check-ignore .\Source\UI\Website\LiveFeeds\Releases\IO\ReleasesSerializer.cs
> git add .\Source\ui\Website\LiveFeeds\Releases\io\ReleasesSerializer.cs
> The following paths are ignored by one of your .gitignore files:
> Source/ui/Website/LiveFeeds/Releases/io/ReleasesSerializer.cs
> Use -f if you really want to add them.
> 
> I get a similar result for adding files in that directory, or the
> parent directory (releases), but the grandparent directory (livefeeds)
> works fine.  Any ideas what might be causing this?

I notice that your "add" and "check-ignore" commands differ in the case of "UI". I think both commands should work correctly when on a case-insensitive filesystem (and a few checks I did after setting core.ignorecase manually seem to confirm this).

But maybe try it with "ui" in the check-ignore command and see if that changes anything?

Another thing I notice is that you're using Windows-style back-slashes for the path separators (whereas internally in Git, everything is front-slashes). AFAIK that's supposed to work everywhere on Windows, but I wouldn't be surprised if there are corner cases where it doesn't. Does switching to:

  git check-ignore ./Source/ui/Website/LiveFeeds/Releases/IO/ReleasesSerializer.cs
help?
-Peff

← back to recent threads