Skip to content

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

  1. 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.

  2. The Context tab appears.

  3. In the Ignore Files section, click the Configure Ignored Files button.

    Configure Ignored Files

  4. The system automatically creates the .ignore file in the .trae folder and opens this file in the editor.

  5. In the .ignore file, add the files to be ignored and save the settings.

  6. Go to the Context tab again.

  7. In the Code Index Management section, click the Rebuild button.

    Rebuild index

  8. 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

Your Ultimate AI-Powered IDE Learning Guide