In molti casi, avrai file o sottoalberi specifici che non vuoi
indicizzare. Ad esempio:
Informazioni altamente sensibili con accesso limitato all'interno della tua organizzazione
Codice obsoleto o deprecato
Codice generato automaticamente o temporaneo
Puoi escludere questi file creando un file .aiexclude.
Come scrivere un file .aiexclude
Un file .aiexclude segue la stessa sintassi di un file .gitignore.
Esempi
Gli esempi seguenti mostrano come configurare un file .aiexclude:
Blocca tutti i file denominati apikeys.txt nella directory contenente il file .aiexclude o al suo interno:
apikeys.txt
Blocca tutti i file con l'estensione .key nella directory o nelle directory al di sotto della directory contenente il file .aiexclude:
*.key
Blocca solo il file apikeys.txt nella stessa directory del file .aiexclude, ma non le sottodirectory:
/apikeys.txt
Blocca tutti i file nella directory my/sensitive/dir e in tutte le sottodirectory.
Il percorso deve essere relativo alla directory che contiene il file .aiexclude.
my/sensitive/dir/
Blocca tutti i file nella directory foo e nelle relative sottodirectory, tranne il file
nominato bar.txt nella directory foo.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-04-09 UTC."],[[["Gemini Code Assist indexes all supported code files in specified repositories by default, but users can exclude certain files."],["An `.aiexclude` file, similar in syntax to `.gitignore`, can be created to exclude specific files or subtrees from being indexed."],["An empty `.aiexclude` file blocks all files within its directory and sub-directories, while patterns within the `.aiexclude` file allow excluding specific file names, extensions, or directory paths."],["Files added to the `.aiexclude` file are dropped from the index within 24 hours if they were previously included."]]],[]]