Skip to main content

GitHub 코필로트의 콘텐츠 제외

Copilot이(가) 특정 콘텐츠에 접근하는 것을 차단하는 방법을 살펴봅니다.

누가 이 기능을 사용할 수 있나요?

Repository administrators, organization owners, and enterprise owners can manage content exclusion settings. People with the "Maintain" role for a repository can view, but not edit, content exclusion settings for that repository.

코파일럿 사업 또는 Copilot Enterprise 플랜을 사용하는 조직입니다.

리포지토리에서 제외할 콘텐츠 설정하기

리포지토리 설정에서 특정 콘텐츠를 지정하면, 해당 항목들이 GitHub Copilot의 분석 대상에서 제외되도록 구성할 수 있습니다.

참고

GitHub Copilot 명령 줄 인터페이스 (CLI), Copilot 코딩 도우미, Copilot 채팅의 IDE 에이전트 모드에서는 콘텐츠 제외 기능을 사용할 수 없습니다. 이러한 Copilot 기능에 대한 자세한 내용은 GitHub 코필로트 CLI 정보, GitHub 코필로트 코딩 에이전트 정보, 및 IDE에서 GitHub Copilot 질문하기을 참조하세요.

  1. GitHub에서 리포지토리의 기본 페이지로 이동합니다. 저장소로 이동 1. 리포지토리 이름 아래에서 Settings를 클릭합니다. "설정" 탭이 표시되지 않으면 드롭다운 메뉴를 선택한 다음 설정을 클릭합니다.

    탭을 보여 주는 리포지토리 헤더의 스크린샷. "설정" 탭이 진한 주황색 윤곽선으로 강조 표시됩니다.
    사이드바 설정

  2. 사이드바의 "Code & automation" 섹션에서 Copilot 을 클릭한 다음, Content exclusion을 클릭합니다.

    해당 리포지토리가 상위 조직이나 동일 enterprise 소속 조직으로부터 제외 설정을 상속받았다면, 페이지 상단의 회색 상자를 통해 관련 상세 정보를 확인할 수 있습니다. 이 설정은 수정이 불가능합니다.

  3. ‘이 리포지토리에서 제외할 경로’ 입력란에 Copilot에서 제외하고자 하는 파일의 경로를 지정하세요.

    형식 - "/PATH/TO/DIRECTORY/OR/FILE"을 사용하며, 각 경로는 별도의 줄에 표시됩니다. 줄 앞에 #을 붙이면 메모를 작성할 수 있습니다.

    fnmatch 패턴 일치 표기법을 사용하여 파일 경로를 지정할 수 있습니다. 패턴은 대/소문자를 구분하지 않습니다. ruby-doc.org 설명서의파일을 참조하세요.

리포지토리 설정에 지정된 경로 예시

YAML
- "/src/some-dir/kernel.rs"

Ignore the /src/some-dir/kernel.rs file in this repository.

- "secrets.json"

Ignore files called secrets.json anywhere in this repository.

- "secret*"

Ignore all files whose names begin with secret anywhere in this repository.

- "*.cfg"

Ignore files whose names end with .cfg anywhere in this repository.

- "/scripts/**"

Ignore all files in or below the /scripts directory of this repository.

# Ignore the `/src/some-dir/kernel.rs` file in this repository.
- "/src/some-dir/kernel.rs"

# Ignore files called `secrets.json` anywhere in this repository.
- "secrets.json"

# Ignore all files whose names begin with `secret` anywhere in this repository.
- "secret*"

# Ignore files whose names end with `.cfg` anywhere in this repository.
- "*.cfg"

# Ignore all files in or below the `/scripts` directory of this repository.
- "/scripts/**"

조직의 콘텐츠 제외 구성하기

조직 설정을 통해 GitHub Copilot이(가) 제외해야 할 콘텐츠를 정의할 수 있습니다. 파일은 Git 리포지토리 내부에 위치하거나, Git의 관리 범위를 벗어난 로컬 파일 시스템 어디에든 존재할 수 있습니다.

  1. GitHub의 오른쪽 위 모서리에서 프로필 사진을 클릭한 다음, Your organizations를 클릭합니다.

  2. 조직 옆에 있는 설정을 클릭합니다.

  3. 왼쪽 사이드바에서 Copilot 을 클릭한 다음, Content exclusion을 차례로 클릭합니다.

  4. Copilot을(를) 제외하려는 파일 위치에 대한 세부 정보를 “제외할 리포지토리 및 경로” 상자에 입력합니다.

    Git 리포지토리 내의 파일이나 다른 위치의 파일을 제외하려면 "*": 을 입력한 후 제외할 파일의 경로를 입력합니다. 여러 파일 경로 패턴을 지정할 때는 각 패턴을 개별 줄에 입력하세요.

    Copilot에서 Git 저장소의 파일을 제외하려면, 저장소에 대한 참조를 한 줄에 입력하고 제외할 파일의 경로를 별도의 줄에 각각 입력합니다. 제외할 파일이 들어 있는 리포지토리를 참조하도록 REPOSITORY-REFERENCE 을 다음 형식으로 대체하세요.

    REPOSITORY-REFERENCE:
      - "/PATH/TO/DIRECTORY/OR/FILE"
      - "/PATH/TO/DIRECTORY/OR/FILE"
      - ...
    

    여러 프로토콜을 통해 리포지토리에 접근할 수 있습니다. 리포지토리의 로컬 복제 방식과 무관하게, REPOSITORY-REFERENCE 및 Copilot에서 다음 구문들을 사용할 수 있습니다:

    http[s]://host.xz[:port]/path/to/repo.git/
    
    git://host.xz[:port]/path/to/repo.git/
    
    [user@]host.xz:path/to/repo.git/
    
    ssh://[user@]host.xz[:port]/path/to/repo.git/
    

    리포지토리에 대해 무시할 경로의 계산에서 user@:portREPOSITORY-REFERENCE 경로는 무시됩니다.

    Azure DevOps의 경우 REPOSITORY-REFERENCE 지정할 때 새(dev.azure.com) 또는 이전(visualstudio.com) 호스트 형식을 사용할 수 있으며Copilot는 리포지토리를 로컬로 복제하는 데 사용된 호스트와 관계없이 일치합니다.

    fnmatch 패턴 일치 표기법을 사용하여 파일 경로를 지정할 수 있습니다. 패턴은 대/소문자를 구분하지 않습니다. ruby-doc.org 설명서의파일을 참조하세요.

조직 설정에서 리포지토리 및 경로 예시

YAML
"*":
  - "**/.env"

Ignore all .env files from all file system roots (Git and non-Git). For example, this excludes REPOSITORY-PATH/.env and also /.env. This could also have been written on a single line as:

"*": ["**/.env"]

octo-repo:

In the octo-repo repository in this organization:

  - "/src/some-dir/kernel.rs"

Ignore the /src/some-dir/kernel.rs file.

https://github.com/primer/react.git:

In the primer/react repository on GitHub:

  - "secrets.json"

Ignore files called secrets.json anywhere in this repository.

  - "/src/**/temp.rb"

Ignore files called temp.rb in or below the /src directory.

git@github.com:*/copilot:

In the copilot repository of any GitHub organization:

  - "/__tests__/**"

Ignore any files in or below the /__tests__ directory.

  - "/scripts/*"

Ignore any files in the /scripts directory.

git@gitlab.com:gitlab-org/gitlab-runner.git:

In the gitlab-org/gitlab-runner repository on GitLab:

  - "/main_test.go"

Ignore the /main_test.go file.

  - "{server,session}*"

Ignore any files with names beginning with server or session anywhere in this repository.

  - "*.m[dk]"

Ignore any files with names ending with .md or .mk anywhere in this repository.

  - "**/package?/*"

Ignore files directly within directories such as packages or packaged anywhere in this repository.

  - "**/security/**"

Ignore files in or below any security directories, anywhere in this repository.

# Ignore all `.env` files from all file system roots (Git and non-Git).
# For example, this excludes `REPOSITORY-PATH/.env` and also `/.env`.
# This could also have been written on a single line as:
#
# "*": ["**/.env"]
"*":
  - "**/.env"

# In the `octo-repo` repository in this organization:
octo-repo:
  # Ignore the `/src/some-dir/kernel.rs` file.
  - "/src/some-dir/kernel.rs"

# In the `primer/react` repository on GitHub:
https://github.com/primer/react.git:
  # Ignore files called `secrets.json` anywhere in this repository.
  - "secrets.json"
  # Ignore files called `temp.rb` in or below the `/src` directory.
  - "/src/**/temp.rb"

# In the `copilot` repository of any GitHub organization:
git@github.com:*/copilot:
  # Ignore any files in or below the `/__tests__` directory.
  - "/__tests__/**"
  # Ignore any files in the `/scripts` directory.
  - "/scripts/*"

# In the `gitlab-org/gitlab-runner` repository on GitLab:
git@gitlab.com:gitlab-org/gitlab-runner.git:
  # Ignore the `/main_test.go` file.
  - "/main_test.go"
  # Ignore any files with names beginning with `server` or `session` anywhere in this repository.
  - "{server,session}*"
  # Ignore any files with names ending with `.md` or `.mk` anywhere in this repository.
  - "*.m[dk]"
  # Ignore files directly within directories such as `packages` or `packaged` anywhere in this repository.
  - "**/package?/*"
  # Ignore files in or below any `security` directories, anywhere in this repository.
  - "**/security/**"

엔터프라이즈의 콘텐츠 제외 구성하기

enterprise 소유자는 enterprise 설정을 통해 GitHub Copilot이 제외해야 할 파일을 지정할 수 있습니다. 파일은 Git 리포지토리 내부에 위치하거나, Git의 관리 범위를 벗어난 로컬 파일 시스템 어디에든 존재할 수 있습니다.

  1. 귀하의 기업으로 이동하세요. 예를 들어 GitHub.com의 Enterprises 페이지에서.
  2. 페이지 맨 위에서 AI 컨트롤을 클릭합니다.
  3. 사이드바에서 Copilot를 클릭하세요.
  4. 콘텐츠 제외를 클릭합니다.
  5. 제외할 콘텐츠는 경로를 통해 지정할 수 있습니다. 이전 섹션인 귀하의 조직을 위한 콘텐츠 제외 설정을 참조하세요.

참고

enterprise 수준의 콘텐츠 제외 규칙은 전사의 모든 Copilot 사용자에게 적용되는 반면, enterprise 수준의 규칙은 해당 조직에서 Copilot 라이선스를 할당받은 사용자에게만 적용됩니다.

콘텐츠 제외 변경 내용 테스트

IDE를 활용하면 콘텐츠 제외 기능의 변경 사항이 의도대로 작동하는지 검증할 수 있습니다.

IDE에서 제외된 콘텐츠의 변경 사항을 전파하기

IDE에서 콘텐츠 제외를 추가하거나 변경한 설정이 적용되기까지는 최대 30분이 소요될 수 있습니다. 기다리고 싶지 않다면, 아래 안내에 따라 콘텐츠 제외 설정을 직접 새로고침할 수 있습니다.

  •         **JetBrains IDE 및 Visual Studio** 의 경우 애플리케이션을 종료한 후 다시 실행하여 콘텐츠 제외 설정을 새로 고칩니다.
    
  •         **Visual Studio Code** 의 경우 다음의 단계를 따라 콘텐츠 제외 설정을 다시 불러옵니다.
    
    1. 명령 팔레트를 열기. 예를 들어, Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux)를 누릅니다.
    2. 다음을 입력합니다. reload
    3.      **개발자: Window 다시 로드**를 선택합니다.
      
  •         **Vim/Neovim**의 경우 GitHub은 파일을 열 때마다 콘텐츠 제외 설정을 자동으로 불러와 적용합니다.
    

콘텐츠 제외 테스트

설정한 콘텐츠 제외 기능이 의도한 대로 동작하는지 검증할 수 있습니다.

  1. 우선 콘텐츠 제외 기능이 적용되지 않은 파일에서 정상적으로 작동하는지 점검합니다. 이 작업을 수행하려면:
    • IDE에서 콘텐츠 제외 대상이 아닌 파일을 열어주세요.
    • 일반적으로 인라인 제안을 생성할 수 있는 편집을 하십시오. 제안 사항이 제공되어야 합니다.
  2. 제외해야 할 파일들을 열어 동일한 방식으로 편집을 진행합니다. 제안 사항이 제공되어서는 안됩니다.
  3. Copilot 채팅에서 콘텐츠 제외를 테스트하려면:
    • IDE에서 Copilot 채팅 패널을 엽니다.

    • 편집기에서 제외할 파일을 연 후 열려 있는 모든 다른 파일을 닫습니다.

    • 현재 열려 있는 파일이 프롬프트의 컨텍스트 파일로 제대로 연결되어 있는지 점검하세요.

    • 프롬프트 explain this file를 입력합니다.

      파일을 제외하면 Copilot 채팅이 해당 파일의 내용을 바탕으로 응답을 생성할 수 없습니다. 이 파일은 Copilot의 답변에서 참조 목록에 포함되지 않습니다.

REST API를 사용하여 콘텐츠 제외 관리

조직 소유자 및 엔터프라이즈 소유자는 GitHub REST API를 사용하여 프로그래밍 방식으로 콘텐츠 제외를 관리할 수도 있습니다.

자세한 내용은 Copilot 콘텐츠 제외 관리를 위한 REST API 엔드포인트을(를) 참조하세요.

추가 참고 자료

  •         [AUTOTITLE](/copilot/concepts/content-exclusion-for-github-copilot)
    
  •         [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/reviewing-changes-to-content-exclusions-for-github-copilot)
    
  •         [Microsoft Learn 설명서에서 Visual Studio의 콘텐츠 제외 구성](https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-github-copilot-admin?view=vs-2022#configure-content-exclusion)