Note
GitHub Copilot Chat in GitHub is currently in パブリック プレビュー and is subject to change.
Overview
GitHub Copilot Chat in GitHub is a chat interface that lets you ask and receive answers to coding-related questions on the GitHub website.
Copilot Chat can help you with a variety of coding-related tasks, like offering you code suggestions, providing natural language descriptions of a piece of code's functionality and purpose, generating unit tests for your code, and proposing fixes for bugs in your code. For more information, see "Responsible use of GitHub Copilot Chat in GitHub."
On GitHub, you can use Copilot Chat to ask:
- General software-related questions, without a particular context. For more information, see "Asking a general question about software development."
- Exploratory questions asked in the context of a specific repository. For more information, see "Asking exploratory questions about a repository."
- Questions asked in the context of a specific repository, file or symbol. For more information, see "Asking a question about a specific file or symbol."
- Questions asked in the context of a knowledge base (that is, Markdown documentation across one or more repositories). For more information, see "Asking a question about a knowledge base."
- Questions about a specific file or specified lines of code within a file. For more information, see "Asking questions about specific pieces of code."
- Questions about a pull request diff. For more information, see "Finding out about the changes in a pull request."
- Questions about a specific issue. For more information, see "Asking a question about a specific issue or discussion."
Limitations
- Chat responses may be suboptimal if you ask questions about a specific repository that you've selected as a context, and the repository has not been indexed for semantic code search. GitHub Copilot のサブスクリプションがあり、リポジトリへの書き込みアクセス権限を持つすべてのユーザーは、そのリポジトリのインデックスを作成できます。 For more information, see "Copilot Chat のリポジトリのインデックス作成."
- The quality of the results from Copilot Chat may, in some situations, be degraded if very large files, or a large number of files, are used as a context for a question.
Powered by skills
Copilot is powered by a collection of skills that are dynamically selected based on the question you ask. You can tell which skill Copilot used by clicking to expand the status information in the chat window.
You can explicitly ask GitHub Copilot Chat in GitHub to use a particular skill - for example, Use the Bing skill to find the latest GPT4 model from OpenAI
.
Currently available skills
You can generate a list of currently available skills by asking Copilot: What skills are available?
The skills you can use in Copilot Chat in GitHub include those shown in the table below.
Skill | Description | Enabled by default? | Example question |
---|---|---|---|
Commit details | Retrieves a list of commits, or the contents of a specific commit, to provide answers to commit-related questions. | Yes | Explain the changes in the code of this commit |
Discussion details | Retrieves a specific GitHub discussion. This is useful for quickly getting the gist of the conversation in a discussion. | Yes | Summarize this discussion |
File details | Retrieves a specific file in the default branch of the Git repository, allowing you to ask questions about the file and the recent changes made to it. This skill is useful when you provide the exact path of a file in the repository. | Yes | What logic does user_auth.js encapsulate? What is the file history of user_auth.js? |
GitHub Advanced Security | Retrieves information about security alerts within your organization from GitHub Advanced Security features (code scanning, secret scanning, and Dependabot alerts). | Yes | How would I fix this code scanning alert? |
Issue details | Retrieves a specific GitHub issue, including the issue's title, number, author, status, body, linked pull requests, comments, and timestamps. | Yes | Summarize the conversation on this issue and suggest next steps |
Lexical code search | Keyword code search in the default branch of the Git repository. This skill is useful when you want to know about specific functions, methods or keywords that exist in the code. This skill leverages most of the functionality available to GitHub Search like symbol and path . | Yes | Find me the tests for the GitService class |
Pull request details | Retrieves a specific pull request. This allows you to ask questions about the pull request, including getting a summary of the pull request, its comments, or the code it changes. | Yes | Summarize this PR for me Summarize the changes in this PR |
Release details | Retrieves the latest, or specified, release. This allows you to find out who created a release, when it happened, and information included in the release notes. | Yes | When was the latest release? |
Repository details | Retrieves a specific GitHub repository. This is useful for finding out details such as the repository owner and the main language used. | Yes | Tell me about this repo |
Semantic code search | Natural language semantic code search in the default branch of the Git repository. This skill is useful when you want to know where or how certain functionality has been implemented in the code. Note: this requires indexing to be enabled for the repository (see "Copilot Chat のリポジトリのインデックス作成"). | Yes Available for all repositories with a Copilot Enterprise subscription, and for public repositories with a Copilot Individual or Copilot Business subscription. | How does this repo manage HTTP requests and responses? |
Support search | Retrieves information from the GitHub Support ポータル. This skill is useful for asking Copilot Chat about GitHub products and support related questions. | Yes | Can I use Copilot knowledge bases with Copilot Individual? |
Web search | Searches the web using the Bing search engine. This skill is useful for teaching Copilot about recent events, new developments, trends, technologies, or extremely specific, detailed, or niche subjects. | No Enable in enterprise or organization settings. | What are some recent articles about SAT tokens securing against vulnerabilities in Node? |
AI models for Copilot Chat
Note
Copilot Chat によって使用される AI モデルを変更する機能は パブリック プレビュー であり、変更される可能性があります。 アクセスを要求するには、記入待ちリストに登録します。
Copilot Chat の パブリック プレビュー のモデル選択に登録されている場合、現在、次のモデルを使用できます。
gpt-4o
: これは、デフォルトの Copilot Chat モデルです。 テキストと画像処理の両方に優れ、迅速に信頼性の高い応答を提供するように設計された、汎用性の高いマルチモーダル モデルです。 また、英語以外の言語でも優れたパフォーマンスを発揮します。o1-preview
: このモデルは、高度な推論と複雑な問題の解決、特に数学と科学に特化しています。gpt-4o
モデルよりも応答速度が下がります。 このモデルでは 1 日あたり 10 件の要求を行うことができます。o1-mini
: これはo1-preview
モデルのより高速なバージョンであり、複雑な推論の使用と、より迅速な応答の必要性のバランスを取ります。 コード生成と小規模なコンテキスト操作に最適です。 このモデルでは 1 日あたり 50 件の要求を行うことができます。
これらのモデルの詳細については、OpenAI プラットフォーム ドキュメントの「モデル」を参照してください。
Limitations of AI models for Copilot Chat
- If you want to use the skills listed in the table above, or knowledge bases, on the GitHub website, you must use the
gpt-4o
model. - Experimental pre-release versions of the models may not interact with all filters correctly, including the duplication detection filter.
Changing your AI model
Note
If you use Copilot Extensions, they may override the model you select.
-
If you access Copilot Chat through a Copilot Business or Copilot Enterprise subscription, your organization or enterprise must grant members the ability to switch to a different model. See "Managing policies for Copilot in your organization" or "企業内の Copilot のポリシーと機能を管理する."
-
In the bottom right of any page on GitHub, click .
-
If the panel contains a previous conversation you had with Copilot, in the top right of the panel, click .
-
In the top right of the panel, select the dropdown menu, then click Take conversation to immersive. Multi-model Copilot Chat is currently only available in the immersive view.
-
In the top left of the immersive view, select the CURRENT-MODEL dropdown menu, then click the AI model of your choice.
Asking a general question about software development
You can ask a general question about software development that is not focused on a particular context, such as a repository or a knowledge base.
Depending on the question you ask, and your enterprise and organization settings, Copilot may respond using information based on the results of a Bing search. By using Bing search, Copilot can answer a broad range of tech-related questions with up-to-date details based on information currently available on the internet. For information on how to enable or disable Bing search integration, see "個人のサブスクライバーとしての Copilot ポリシーの管理" and "企業内の Copilot のポリシーと機能を管理する."
Note
Bing search integration into Copilot Chat in GitHub is currently in パブリック プレビュー and is subject to change.
-
GitHub の任意のページで、ページの右下にある GitHub Copilot アイコンをクリックします。
GitHub Copilot Chat パネルが表示されます。 パネルのサイズ変更を行うには、上端または左端をクリックしてドラッグします。
-
パネルに Copilot で行った以前の会話が含まれている場合は、パネルの右上にある [新しい会話] アイコン (プラス記号) をクリックします。
-
If the panel is headed "Chatting about OWNER/REPOSITORY," click All repositories.
-
If the "Ask Copilot" page is displayed in the panel, click General purpose chat.
-
At the bottom of the panel, in the "Ask Copilot" box, type a question and press Enter.
Some examples of general questions you could ask are:
- What are the advantages of the Go programming language?
- What is Agile software development?
- What is the most popular JavaScript framework?
- Give me some examples of regular expressions.
- Write a bash script to output today's date.
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
-
If Copilot uses a Bing search to answer your question, "Results from Bing" is displayed above the response. Click this to see the search results that Copilot used to answer your question.
-
Within a conversation thread, you can ask follow-up questions. Copilot will answer within the context of the conversation. For example, you could type "tell me more" to get Copilot to expand on its last comment.
You can use your initial question as a foundation for follow-up questions. A detailed foundational prompt can help Copilot provide more relevant answers to your follow-up questions. For more information, see "Prompting GitHub Copilot Chat to become your personal AI assistant for accessibility" on the GitHub Blog.
-
Copilot との以前の会話に戻るには、パネルの右上にある [会話表示] アイコン (円形の矢印で囲まれた時計の文字盤) をクリックします。
Asking exploratory questions about a repository
Copilot allows you to use natural language questions to explore repositories on GitHub. This can help you get a better understanding of where specific aspects of a codebase are implemented.
-
On the GitHub website, go to the repository you want to chat about.
-
Click the GitHub Copilot icon at the bottom right of the page.
The GitHub Copilot Chat panel is displayed. To resize the panel, click and drag the top or left edge.
-
The heading at the top of the panel should read "Chatting about" followed by the name of the current repository.
If the wrong repository name is displayed, because you were previously chatting about another repository, click All repositories then choose the repository you want to chat about.
-
In the "Ask Copilot" box, at the bottom of the chat panel, type a question and press Enter.
For example, you could ask:
- When was the most recent release?
- Where is rate limiting implemented in our API?
- How does the WidgetFactory class work?
- Where is the code for updating a phone number?
- Where are SAT tokens generated?
- Show the most recently updated issues assigned to USERNAME
- List open issues about SUBJECT
- What was the last merged PR by USERNAME
- What are the latest commits to the main branch by USERNAME
Copilot replies in the chat panel.
Note
Copilot's ability to answer natural language questions like these in a repository context is improved when the repository has been indexed for semantic code search. The indexing status of the repository is displayed when you start a conversation that has a repository context. For more information, see "Copilot Chat のリポジトリのインデックス作成."
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
-
Copilot との以前の会話に戻るには、パネルの右上にある [会話表示] アイコン (円形の矢印で囲まれた時計の文字盤) をクリックします。
Asking a question about a specific file or symbol
You can ask Copilot about a specific file or symbol within a repository.
Note
A "symbol" is a named entity in code. This could be a variable, function, class, module, or any other identifier that's part of a codebase.
-
GitHub の任意のページで、ページの右下にある GitHub Copilot アイコンをクリックします。
GitHub Copilot Chat パネルが表示されます。 パネルのサイズ変更を行うには、上端または左端をクリックしてドラッグします。
-
パネルに Copilot で行った以前の会話が含まれている場合は、パネルの右上にある [新しい会話] アイコン (プラス記号) をクリックします。
-
パネルに [Copilot に質問する] ページが表示されない場合は、[すべてのリポジトリ] をクリックします。
-
[Copilot に質問する] ページで、質問のコンテキストを提供するリポジトリを選択します。
たとえば、コードをよりよく理解したいリポジトリを選択できます。
使用するリポジトリが表示されない場合は、検索できます。
-
Click the "Attach files or symbols" button (a paperclip icon) at the bottom of the chat panel, then search for and select one or more files and symbols.
-
In the "Ask Copilot" box, type a question and press Enter.
Copilot replies in the chat panel.
Note
Copilot's ability to answer natural language questions in the context of a repository is improved when the repository has been indexed for semantic code search. The indexing status of the repository is displayed when you start a conversation that has a repository context. For more information, see "Copilot Chat のリポジトリのインデックス作成."
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
-
Copilot との以前の会話に戻るには、パネルの右上にある [会話表示] アイコン (円形の矢印で囲まれた時計の文字盤) をクリックします。
Asking a question about a knowledge base
Organization owners (with a Copilot Enterprise subscription) can create knowledge bases, grouping together Markdown documentation across one or more repositories. You can use a knowledge base to ask questions with that context in mind.
When you enter a query, Copilot searches for relevant documentation snippets, synthesizes a summary of the relevant snippets to answer your question, and provides links to the source documentation for additional context.
-
GitHub の任意のページで、ページの右下にある GitHub Copilot アイコンをクリックします。
GitHub Copilot Chat パネルが表示されます。 パネルのサイズ変更を行うには、上端または左端をクリックしてドラッグします。
-
パネルに Copilot で行った以前の会話が含まれている場合は、パネルの右上にある [新しい会話] アイコン (プラス記号) をクリックします。
-
If the "Ask Copilot" page is not displayed in the panel, click All repositories.
-
Start a conversation with Copilot by either selecting a repository or clicking General purpose chat.
-
Click the "Attach knowledge" button (a book icon) at the bottom of the chat panel, to view a list of the knowledge bases that you have access to.
-
Click the knowledge base that you want to use as context.
For example, you could choose a knowledge base containing your organization's internal developer documentation.
You can search for a knowledge base if you don't see one you want to use.
-
At the bottom of the page, in the "Ask Copilot" box, type a question and press Enter.
For example, if you chose a knowledge base with your organization's internal developer documentation, you could ask:
- How do I deploy a new application?
- What's the process for creating a new REST API?
- What are our best practices for logging?
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
-
The response will typically contain numbered references to files that Copilot uses to generate the answer, from the knowledge base you selected. To list the sources that were used, click NUMBER references.
-
To display information about a source reference, click its entry in the list.
Alternatively, to open the complete file, click the ellipsis (...), then select Open.
-
Within a conversation thread, you can ask follow-up questions. Follow-up questions will continue to use the selected knowledge base as context until you explicitly detach the knowledge base or select a different one.
-
Copilot との以前の会話に戻るには、パネルの右上にある [会話表示] アイコン (円形の矢印で囲まれた時計の文字盤) をクリックします。
Asking questions about specific pieces of code
You can chat with Copilot about a file in your repository, or about specific lines of code within a file.
-
On GitHub, navigate to a repository and open a file.
-
Do one of the following:
-
To ask a question about the entire file, click the Copilot icon () at the top right of the file view.
-
To ask a question about specific lines within the file:
- Select the lines by clicking the line number for the first line you want to select, holding down Shift and clicking the line number for the last line you want to select.
- To ask your own question about the selected lines, click the Copilot icon () to the right of your selection. This displays the GitHub Copilot Chat panel with the selected lines indicated as the context of your question.
- To ask a predefined question, click the downward-pointing button beside the Copilot icon, then choose one of the options.
-
-
If you clicked the Copilot icon, type a question in the "Ask Copilot" box at the bottom of the chat panel and press Enter.
For example, if you are asking about the entire file, you could enter:
- Explain this file.
- How could I improve this code?
- How can I test this script?
If you are asking about specific lines, you could enter:
- Explain the function at the selected lines.
- How could I improve this class?
- Add error handling to this code.
- Write a unit test for this method.
Copilot responds to your request in the panel.
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
-
You can continue the conversation by asking a follow-up question. For example, you could type "tell me more" to get Copilot to expand on its last comment.
-
To clear, delete, or rename the current conversation thread, or to start a new thread, type
/
in the "Ask Copilot" box, select from the options that are displayed, then press Enter. -
To view a conversation in immersive mode, displaying just the conversation thread, click at the top right of the conversation thread, then click Take conversation to immersive.
Asking questions about GitHub Advanced Security alerts
Copilot allows you to use natural language questions to ask about security alerts in repositories in your organization when these alerts are generated by GitHub Advanced Security features (code scanning, secret scanning, and Dependabot alerts).
-
GitHub の任意のページで、ページの右下にある GitHub Copilot アイコンをクリックします。
GitHub Copilot Chat パネルが表示されます。 パネルのサイズ変更を行うには、上端または左端をクリックしてドラッグします。
-
パネルに Copilot で行った以前の会話が含まれている場合は、パネルの右上にある [新しい会話] アイコン (プラス記号) をクリックします。
-
If the "Ask Copilot" page is not displayed in the panel, click All repositories.
-
On the "Ask Copilot" page, select a repository to provide a context for your question.
For example, you could choose a repository with security alerts you want to understand better.
You can search for a repository if you don't see one you want to use.
-
In the "Ask Copilot" box, type a question and press Enter.
For example, you could ask:
- How would I fix this alert?
- How many alerts do I have on this pull request?
- Which line of code is this code scanning alert referencing?
- What library is affected by this Dependabot alert?
Copilot replies in the chat panel.
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
-
Copilot との以前の会話に戻るには、パネルの右上にある [会話表示] アイコン (円形の矢印で囲まれた時計の文字盤) をクリックします。
Asking questions about a specific pull request
You can ask Copilot to summarize a pull request, or explain what has changed within specific files or lines of code in a pull request.
Get a summary of a pull request
-
On GitHub, navigate to a pull request in a repository.
-
ページの右下で、 GitHub Copilot アイコンをクリックします。
GitHub Copilot Chat パネルが表示されます。 パネルのサイズ変更を行うには、上端または左端をクリックしてドラッグします。
-
パネルに Copilot との以前の会話が含まれている場合、Copilot パネルの右上にある プラス記号アイコンをクリックして、新しい会話を開始します。
-
At the bottom of the Copilot Chat panel, in the "Ask Copilot" box, type a question and press Enter.
For example, you could ask:
- Summarize this PR for me.
- Summarize the comments in this PR.
- Summarize the changes in this PR.
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
Ask about changes to a specific file in a pull request
-
On GitHub, navigate to a pull request in a repository.
-
Click the Files changed tab.
-
Click at the top right of the file, then click Ask Copilot about this diff.
-
Type a question in the "Ask Copilot" box at the bottom of the chat panel and press Enter.
For example, you could ask:
- What's the purpose of this file?
- Why has this module been included?
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
Ask about specific lines within a file in a pull request
-
On GitHub, navigate to a pull request in a repository.
-
Click the Files changed tab.
-
Click the line number for the first line you want to select, then hold down Shift and click the line number for the last line you want to select.
-
Ask Copilot a question, or choose from a list of predefined questions.
-
To ask your own question about the selected lines, to the right of your selection, click the Copilot icon. This displays the GitHub Copilot Chat panel with the selected lines indicated as the context of your question.
For example, you could ask:
- What is `actorData` in this line?
- Explain this `do..end` block.
-
To ask a predefined question, to the right of your selection, beside the Copilot icon, click , then click Explain.
-
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
Ask why a workflow has failed
Note
This feature is currently in パブリック プレビュー and subject to change.
-
On GitHub, navigate to a pull request in a repository.
-
Scroll to the bottom of the page, then, next to one of the failing checks, click Details.
-
ページの右下で、 GitHub Copilot アイコンをクリックします。
GitHub Copilot Chat パネルが表示されます。 パネルのサイズ変更を行うには、上端または左端をクリックしてドラッグします。
-
パネルに Copilot との以前の会話が含まれている場合、Copilot パネルの右上にある プラス記号アイコンをクリックして、新しい会話を開始します。
-
At the bottom of the Copilot Chat panel, in the "Ask Copilot" box, ask Copilot why the pull request has failed and press Enter.
For example, you could ask:
- Tell me why this job failed
- Suggest a fix for this error
Copilot will respond with information about why the pull request failed. Copilot may also provide suggestions for how to fix the issue.
- If Copilot has provided steps to fix the issue, you can follow the steps to resolve the problem.
- 必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
Asking a question about a specific issue or discussion
You can ask Copilot to summarize or answer questions about a specific issue or discussion.
Note
The quality of Copilot Chat's responses may be degraded when working with issues or discussions that have very long bodies or a large number of comments. For example, this may occur if you ask Copilot to summarize a long-running discussion. Where this happens, Copilot will warn you so you can double check its output.
-
Navigate to an issue or discussion on GitHub.
-
ページの右下で、 GitHub Copilot アイコンをクリックします。
GitHub Copilot Chat パネルが表示されます。 パネルのサイズ変更を行うには、上端または左端をクリックしてドラッグします。
-
パネルに Copilot との以前の会話が含まれている場合、Copilot パネルの右上にある プラス記号アイコンをクリックして、新しい会話を開始します。
-
At the bottom of the Copilot chat panel, in the "Ask Copilot" box, type a question and press Enter. For example, you could enter:
-
Explain this issue
-
Summarize this discussion
-
Recommend next steps for this issue
-
What are the acceptance criteria for this issue?
-
What are the main points made by PERSON in this discussion?
Tip
Instead of navigating to an issue or discussion in your browser to ask a question, you can include the relevant URL in your message. For example,
Summarize https://github.com/monalisa/octokit/issues/1
.Copilot responds to your request in the panel.
-
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
Asking a question about a specific commit
You can ask Copilot to explain the changes in a commit.
-
Navigate to a commit on GitHub.
-
ページの右下で、 GitHub Copilot アイコンをクリックします。
GitHub Copilot Chat パネルが表示されます。 パネルのサイズ変更を行うには、上端または左端をクリックしてドラッグします。
-
パネルに Copilot との以前の会話が含まれている場合、Copilot パネルの右上にある プラス記号アイコンをクリックして、新しい会話を開始します。
-
At the bottom of the Copilot chat panel, in the "Ask Copilot" box, type a question and press Enter. For example, you could enter:
-
Summarize the changes in this commit
-
Who committed these changes?
-
When was this commit made?
Tip
If you know the SHA for a commit, instead of navigating to the commit, you can ask Copilot about the commit from any page in the repository on GitHub by including the SHA in your message. For example,
What changed in commit a778e0eab?
-
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
Accessing Copilot Chat from the search bar
You can ask Copilot a question about an entire repository by typing your question in the main search box of the repository.
-
Navigate to a repository on GitHub.
-
Press /, or click in the main search box at the top of the page.
-
In the search box, after
repo:OWNER/REPO
, type the question you want to ask Copilot.For example, you could enter:
- What does this repo do?
- Where is authentication implemented in this codebase?
- How does license file detection work in this repo?
-
Click Ask Copilot.
The GitHub Copilot Chat panel is displayed and Copilot responds to your request.
-
必要に応じて、テキスト ボックスの をクリックして、Copilot が応答を続行しないようにします。
Extending Copilot Chat in GitHub
Note
GitHub Copilot Extensions は パブリック プレビュー 段階であり、変更される可能性があります。
GitHub Copilot Extensions は、外部ツールの機能を Copilot Chat に統合することで、コンテキストの切り替えを減らし、ドメイン固有のコンテキストで応答を受信するのに役立ちます。 GitHub Marketplace から Copilot Extensions をインストールするか、組織内にあるプライベートの Copilot Extensions をビルドし、チャット ウィンドウに「@
」と入力すると、使用可能な拡張機能の一覧を表示できます。 拡張機能を使用するには、一覧から拡張機能を選択するか、完全な置換フィールド名を入力し、プロンプトを入力します。
詳細については、「拡張情報を使用して外部ツールを Copilot Chat と統合する」を参照してください。
Sharing feedback about GitHub Copilot Chat in GitHub
Note
Copilot pull request summaries に関するフィードバックを GitHub に提供する機能は、エンタープライズ設定によって異なります。 詳しくは、「企業内の Copilot のポリシーと機能を管理する」を参照してください。
To give feedback about a particular Copilot Chat response, click either the thumbs up or thumbs down icon at the bottom of each chat response.
To give feedback about Copilot Chat in general, click the ellipsis (...) at the top right of the chat panel, then click Give feedback.