.aiexclude dosyalarıyla bağlam paylaşımını yapılandırma
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Android Studio'da proje bağlamınızı Gemini ile paylaşmayı etkinleştirdiğinizde, .aiexclude
dosyalarını kullanarak kod tabanındaki hangi dosyaların paylaşılacağını kontrol edebilirsiniz. Android Studio'daki yapay zeka özellikleri, geçerli proje ve ona bağlı sürüm kontrolü kökleri dışındaki dosyalara erişemez. Bu nedenle, yapay zeka özelliklerinin hangi dosyalara erişmesine izin verileceğini kontrol etmek için .aiexclude
dosyalarını proje ve VCS kökleri içinde herhangi bir yere yerleştirebilirsiniz.
.gitignore
dosyasına benzer şekilde, .aiexclude
dosyası da Android Studio'da Gemini ile paylaşılmaması gereken dosyaları (sohbet deneyimi ve düzenleyicide çalışan yapay zeka özellikleri (ör. kod tamamlama) dahil) izler. Bir .aiexclude
dosyası, kendisini içeren dizindeki veya bu dizinin altındaki dosyalar üzerinde çalışır.

.aiexclude
dosyaları yazma
.aiexclude
dosyası, .gitignore
dosyası ile aynı söz dizimine sahiptir.
Örnekler
Aşağıda örnek .aiexclude
dosyası yapılandırmaları verilmiştir:
KEYS
kalıbı, .aiexclude
dosyasını içeren dizinde veya bu dizinin altında bulunan ve dosya uzantısı olmayan "KEYS" adlı tüm dosyaları engeller.
KEYS
KEYS.*
kalıbı, . içeren dizinde veya bu dizinin altında bulunan, dosya uzantısı ne olursa olsun "KEYS" adlı tüm dosyaları engeller.aiexclude
dosyası.
KEYS.*
*.kt
kalıbı, .aiexclude
dosyasını içeren dizinde veya bu dizinin altında bulunan tüm Kotlin dosyalarını ya da .kt
uzantılı dosyaları engeller.
*.kt
/*.kt
kalıbı, .aiexclude
dizinindeki tüm .kt
dosyalarını engeller ancak alt dizinlerdeki dosyaları engellemez.
/*.kt
my/sensitive/dir/
kalıbı, my/sensitive/dir
dizinindeki ve altındaki tüm dosyaları engeller. Dosya yolu, .aiexclude
dosyasını içeren dizine göre belirlenir.
my/sensitive/dir/
my/sensitive/dir/**/.txt
kalıbı, my/sensitive/dir/
dizinindeki veya bu dizinin altındaki tüm .txt
dosyalarını engeller.
my/sensitive/dir/**/.txt
my/sensitive/dir/*.txt
kalıbı, my/sensitive/dir
dizinindeki tüm .txt
dosyalarını engeller ancak alt dizinlerdeki dosyaları engellemez.
my/sensitive/dir/*.txt
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-31 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-31 UTC."],[],[],null,["# Configure context sharing with .aiexclude files\n\nWhen you opt in to sharing your project context with Gemini in Android Studio,\nyou can control which files specifically from the codebase are shared using\n`.aiexclude` files. AI features in Android Studio cannot access files outside of\nthe current project and the version control roots attached to it. With this in\nmind, you can place `.aiexclude` files anywhere within the project and its VCS\nroots to control which files AI features are allowed to access.\n\nMuch like a `.gitignore` file, an `.aiexclude` file tracks files that shouldn't\nbe shared with Gemini in Android Studio, including the chat experience as well\nas AI features that operate in the editor, like [code completion](/studio/gemini/code-completion). An\n`.aiexclude` file operates on files at or below the directory that contains it.\n\nHow to write `.aiexclude` files\n-------------------------------\n\nAn `.aiexclude` file follow the same syntax as a\n[`.gitignore` file](https://git-scm.com/docs/gitignore).\n\nExamples\n--------\n\nHere are example `.aiexclude` file configurations:\n\n- The pattern `KEYS` blocks all files called \"KEYS\" with no file extension at or below the directory that contains the `.aiexclude` file.\n\n KEYS\n\n- The pattern `KEYS.*` blocks all files called \"KEYS\" with any file extension at or below the directory that contains the .`aiexclude` file.\n\n KEYS.*\n\n- The pattern `*.kt` blocks all Kotlin files, or files with the extension `.kt`, at or below the directory that contains the `.aiexclude` file.\n\n *.kt\n\n- The pattern `/*.kt` blocks all `.kt` files in the `.aiexclude` directory, but not below.\n\n /*.kt\n\n- The pattern `my/sensitive/dir/` blocks all files in the `my/sensitive/dir` directory and below. The file path is relative to the directory that contains the `.aiexclude` file.\n\n my/sensitive/dir/\n\n- The pattern `my/sensitive/dir/**/.txt` blocks all `.txt` files at or below the directory `my/sensitive/dir/`.\n\n my/sensitive/dir/**/.txt\n\n- The pattern `my/sensitive/dir/*.txt` blocks all `.txt` files in the directory `my/sensitive/dir`, but not in sub-directories.\n\n my/sensitive/dir/*.txt"]]