Yo, is this my project or aiexclusion is conflicting with whatever in .gitignore file?

I’m developing the GO app using a Gemini-integrated development environment. I’ve observed a consistent behavior following a code push to GitHub:

  • Files excluded via .gitignore are automatically being treated as excluded for the AI chat feature.

    *sorry for the longa*s file since I can only upload one media :3

  • The AI context menu says the message: “The current file is hidden from chat using .aiexclude”.

  • Crucially, trying to explicitly include a file (e.g., chats.txt) by using the un-exclusion pattern !chats.txt within the .aiexclude file is unsuccessful.

This seems to stem from a policy that links the contents of .gitignore to AI exclusion, likely for security purposes (e.g, protecting configuration files like .env). My requirement is to provide the AI with context from local, ignored files (like specific documentation or context notes) without pushing them to the repository. I need a reliable method to make these specific files available to the AI.

The current workaround is to disable the .gitignore file temporarily by deleting or renaming it while we are working.
I believe this is tedious and dangerous in case we forgot to add back before we push, and we should be able to control things with just .aiexclude file.

Note that .aiexclue is primarily used by Gemini Code Assist (the IDE plugin) while Gemini CLI uses .geminiignore.

  1. Try creating a local settings file at .gemini/settings.json and add the following configuration to disable the Git ignore check:
    { "context": { "fileFiltering": { "respectGitIgnore": false } } }
    create a .geminiignore file in your project root, and curate its content accordingly. make sure to add .gemini to your .gitignore
  2. if you only need to read an ignored file once, you can use the shell command feature (!) or piping to pass the file content directly.

    Here is some context:
    ! cat path/to/ignored_notes.md
    ..
    cat ignored_notes.md | gemini -p "Use this context to..."

Since I’m just using the Firebase Studio built-in Gemini IDE extension, the initial suggested step didn’t work. I mean, I can successfully exclude files not listed in .gitignore by adding them to .aiexclude. However, all files listed in .gitignore are automatically ignored by the extension, and the only way to un-ignore them is by removing them from the .gitignore file itself. And of course, also trying to exclude the files from .geminiignore didn’t work too.

And also, it’s ignoring ‘.gemini/settings.json’ path too since I added the path in .gitignore file.