Ignore files
Trae IDE ignores files listed in the .gitignore file by default. You can also set up an additional list of files to ignore when indexing the repository, which serves as a supplement to the rules defined in the .gitignore file.
Important note
When adding context using #Workspace or #Folder, any ignored files or folders will not be included as context.
Procedure
At the top right of the side chat box, click the Settings icon > Context, or click # Context > Doc > Add New Doc in the input box of side chat.
The Context tab appears.
In the Ignore Files section, click the Configure Ignored Files button.
The system automatically creates the .ignore file in the .trae folder and opens this file in the editor.
In the .ignore file, add the files to be ignored and save the settings.
Go to the Context tab again.
In the Code Index Management section, click the Rebuild button.
Trae IDE re-indexes the current project, including the .ignore file in the process. The .ignore file will take effect after re-indexing is complete.
Example
Below is the example content in the .ignore file:
**/foo: To ignore /foo, a/foo, a/b/foo, and more other files with /foo
*.log: To ignore all .log files
config.js: To ignore the config.js file in the current directory
/mtk/ To ignore the whole folder
*.zip To ignore all .zip files
/mtk/do.c To ignore a specified file