.ai제외 파일로 컨텍스트 공유 구성
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android 스튜디오에서 Gemini와 프로젝트 컨텍스트를 공유하도록 선택하면 .aiexclude
파일을 사용하여 코드베이스에서 공유할 파일을 구체적으로 제어할 수 있습니다. Android 스튜디오의 AI 기능은 현재 프로젝트와 연결된 버전 관리 루트 외부의 파일에 액세스할 수 없습니다. 이를 염두에 두고 프로젝트 및 VCS 루트 내 원하는 위치에 .aiexclude
파일을 배치하여 AI 기능이 액세스할 수 있는 파일을 제어할 수 있습니다.
.gitignore
파일과 마찬가지로 .aiexclude
파일은 채팅 환경과 편집기에서 작동하는 AI 기능(예: 코드 완성)을 포함하여 Android 스튜디오의 Gemini와 공유해서는 안 되는 파일을 추적합니다. .aiexclude
파일은 이를 포함하는 디렉터리나 그 아래에 있는 파일에서 작동합니다.

.aiexclude
파일 작성 방법
.aiexclude
파일은 .gitignore
파일과 동일한 구문을 따릅니다.
예
다음은 .aiexclude
파일 구성의 예입니다.
KEYS
패턴은 .aiexclude
파일이 포함된 디렉터리나 그 아래에서 파일 확장자가 없는 'KEYS'라는 모든 파일을 차단합니다.
KEYS
KEYS.*
*.kt
패턴은 .aiexclude
파일이 포함된 디렉터리나 그 아래에서 모든 Kotlin 파일 또는 확장자가 .kt
인 파일을 차단합니다.
*.kt
/*.kt
패턴은 .aiexclude
디렉터리의 모든 .kt
파일을 차단하지만 그 아래는 차단하지 않습니다.
/*.kt
my/sensitive/dir/
패턴은 my/sensitive/dir
디렉터리 및 그 아래의 모든 파일을 차단합니다. 파일 경로는 .aiexclude
파일이 포함된 디렉터리를 기준으로 합니다.
my/sensitive/dir/
my/sensitive/dir/**/.txt
패턴은 my/sensitive/dir/
디렉터리나 그 아래에 있는 모든 .txt
파일을 차단합니다.
my/sensitive/dir/**/.txt
my/sensitive/dir/*.txt
패턴은 my/sensitive/dir
디렉터리의 모든 .txt
파일을 차단하지만 하위 디렉터리의 파일은 차단하지 않습니다.
my/sensitive/dir/*.txt
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-31(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 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"]]