Files mentioned in .gitignore are not getting ignored #3088

Open
opened 2026-02-16 17:38:33 -05:00 by yindo · 1 comment
Owner

Originally created by @mercedesyenzzz on GitHub (Nov 24, 2025).

Originally assigned to: @rekram1-node on GitHub.

For some reason glob does not ignore files mentioned in my .gitignore (v 1.0.45 on MacOS).

I am running open code from the root of my repository. In that directory I have a .gitignore with the following section:

# Terraform files
*.tfstate
*.tfstate.backup
.terraform/
*.tfvars
Is there any tfvar file in this repository ?
username (4:44:18 PM)
✱ Glob "**/*.tfvars" (2 matches)
Yes, there are two .tfvars files in this repository:
1. /infra/terraform/environments/netbird/terraform.tfvars
2. /infra/terraform/environments/azure/terraform.tfvars

Wondering how that's possible, because you have this mentioned in your docs:

Internally, tools like grep, glob, and list use [ripgrep](https://github.com/BurntSushi/ripgrep) under the hood. By default, ripgrep respects .gitignore patterns, which means files and directories listed in your .gitignore will be excluded from searches and listings.

Still I like opencode a lot, keep up the good work :)

Originally created by @mercedesyenzzz on GitHub (Nov 24, 2025). Originally assigned to: @rekram1-node on GitHub. For some reason glob does not ignore files mentioned in my `.gitignore` (v 1.0.45 on MacOS). I am running open code from the root of my repository. In that directory I have a `.gitignore` with the following section: ``` # Terraform files *.tfstate *.tfstate.backup .terraform/ *.tfvars ``` ``` Is there any tfvar file in this repository ? username (4:44:18 PM) ✱ Glob "**/*.tfvars" (2 matches) Yes, there are two .tfvars files in this repository: 1. /infra/terraform/environments/netbird/terraform.tfvars 2. /infra/terraform/environments/azure/terraform.tfvars ``` Wondering how that's possible, because you have this mentioned in your docs: `Internally, tools like grep, glob, and list use [ripgrep](https://github.com/BurntSushi/ripgrep) under the hood. By default, ripgrep respects .gitignore patterns, which means files and directories listed in your .gitignore will be excluded from searches and listings.` Still I like opencode a lot, keep up the good work :)
Author
Owner

@github-actions[bot] commented on GitHub (Nov 24, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4633: It should be possible to instruct opencode which files to ignore
  • #2517: A way to disable .gitignore-based filtering to the list tool
  • #3164: Exclude files from being used

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 24, 2025): This issue might be a duplicate of existing issues. Please check: - #4633: It should be possible to instruct opencode which files to ignore - #2517: A way to disable .gitignore-based filtering to the `list` tool - #3164: Exclude files from being used Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3088