Introduction
This guide describes how to use Copilot 对话助手 to ask questions about software development in GitHub. You can ask general questions about software development, or specific questions about the issues or code in a repository. For more information, see 关于 GitHub Copilot Chat.
Submitting a question to Copilot 对话助手
You can open Copilot 对话助手 from any page on GitHub. Certain questions may require you to be in a specific context, such as a repository, issue, or pull request. The following procedure describes how to ask a general software related question, and demonstrates the core functionality of Copilot 对话助手 on GitHub. For more information on other scenarios, see Asking Copilot 对话助手 questions in different contexts.
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 的策略和功能.
-
在 GitHub 上的任意页面的右上角,单击搜索栏旁边的 按钮****。
随即将显示 Copilot 对话助手 的完整页面沉浸式模式。
-
In the prompt box, type a question and press Enter.
Some examples of general questions you could ask are:
-
或者,提交问题后,可以在文本框中单击 以停止响应。
-
If Copilot uses a Bing search to answer your question, you can click the n references link at the top of the response 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.
-
To start a new conversation, click at the top left of the page.
-
To see a list of your previous conversations, click at the top left of the page.
Copilot 对话助手 retains each conversation for up to 28 days from the last activity. After 28 days, the conversation is permanently deleted. You can view up to 100 previous conversations.
Viewing and editing generated files within Copilot 对话助手
注意
This feature is currently in 公共预览版 and subject to change.
When you ask a question, Copilot may generate one or more files as part of its response. In the Copilot 对话助手 panel, the files are displayed inline, within the chat response. In immersive view (that is, at https://github.com/copilot), the generated files are displayed in a side panel. You can view and edit the files in the panel, or download them to your computer.
For example, asking Generate a simple calculator using HTML, CSS, and JavaScript
may generate multiple files, such as index.html
, styles.css
, and script.js
.
In immersive view, you can also preview how some file formats, such as Markdown, render by toggling to the "Preview" tab in the side panel.
Regenerating a response with a different model
After Copilot responds to your question, you can regenerate the same prompt using a different model by clicking the retry icon () below the response. The new response will use your selected model and maintain the full context of the conversation.
You can switch between responses to compare the results from different models.
For help deciding which model to use, see AI 模型比较.
Using subthreads in a conversation
Subthreads are branches of a conversation that are created from a point in a conversation where you asked a question. Subthreads offer more control and flexibility for exploring aspects of a topic, or new topics, all within the same thread.
You can create and navigate through subthreads in Copilot 对话助手's immersive view. In the Copilot 对话助手 panel, if you open a conversation that contains subthreads, only the most recently edited subthread is displayed.
You can create a subthread in immersive mode by either editing or retrying any of your questions in the conversation.
To edit a question:
-
Hover over the question you want to edit.
-
Click the button that's displayed.
-
Edit the question, then click Send.
注意
You can only edit the text of a question. You can't edit any attachments.
To retry a question:
-
Hover over the response to a question you want to retry. Resubmitting a question to Copilot may generate a different response.
-
Click the button.
The response to your edited or retried question is displayed in a new subthread.
To navigate between subthreads:
-
If you have retried a question, a retry counter is displayed under the response, alongside the retry button.
Click or to navigate to the previous or next subthread.
-
If you have edited a question, an edit counter is added below the question.
Hover over the counter to display the edit and navigation buttons, then click or to navigate to the previous or next subthread.
Powered by skills
Copilot has access to a collection of skills to fetch data from GitHub, which are dynamically selected based on the question you ask.
You can explicitly ask GitHub 中的 GitHub Copilot Chat to use a particular skill - for example, Use the Bing skill to find the latest GPT4 model from OpenAI.
Generate a list of currently available skills by asking Copilot: What skills are available?
Asking Copilot 对话助手 questions in different contexts
You can ask Copilot 对话助手 different types of questions depending on where you are on GitHub. For example, to ask a question about a specific repository, you must be in the context of that repository. The following sections describe how to access the different contexts.
For examples of the types of questions you can ask in different contexts, see Getting started with prompts for GitHub Copilot Chat.
Using images in Copilot 对话助手
注意
- Attaching images to chat prompts is currently in 公共预览版 and is subject to change.
- You can only attach an image in the immersive view of Copilot 对话助手 (https://github.com/copilot), not in the chat panel.
You can attach an image to Copilot and then ask about the image. For example, you can attach:
- 代码片段屏幕截图,以及要求 Copilot 解释代码。
- 应用程序的用户界面模拟,以及要求 Copilot 生成代码。
- 流程图,以及要求 Copilot 描述图像中显示的流程。
- 网页的屏幕截图,以及要求 Copilot 生成类似页面的 HTML。
注意
支持以下类型的图像文件:JPEG(.jpg
、.jpeg
)、PNG (.png
)、GIF (.gif
) 或 WEBP (.webp
)。
Attaching an image to your chat prompt
-
Go to the immersive view of Copilot 对话助手 (https://github.com/copilot).
-
If you see the AI model picker at the top of the page, select one of the models that supports adding images to prompts:
- GPT-4.1 (the default that's used if you don't see a model picker)
- GPT-5 mini
- GPT-5
- Claude Sonnet 3.5
- Claude Sonnet 3.7
- Gemini 2.0 Flash
- Gemini 2.5 Pro
-
Do one of the following:
- Copy an image and paste it into the prompt box at the bottom of the page.
- Click in the prompt box, then click Image. Browse to the image file you want to attach, select it and click Open.
- Drag and drop an image file from your operating system's file explorer into the prompt box.
-
在聊天视图中键入提示以随附图像。 例如:
explain this diagram
、describe each of these images in detail
、what does this error message mean
。
Accessing Copilot 对话助手 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.
-
或者,提交问题后,可以在文本框中单击 以停止响应。
Accessing Copilot 对话助手 from the dashboard
You can access Copilot's immersive view from the dashboard. The dashboard is your personalized overview of your activity on GitHub, seen when you visit https://github.com while logged in.
-
Go to the dashboard at https://github.com.
-
In the prompt box, type a question and press Enter.
You will be taken to the immersive view where Copilot responds to your request.
注意
If you don't see the Copilot 对话助手 prompt box on your dashboard, check that Dashboard entry point in enabled in your GitHub Copilot settings.
Sharing Copilot 对话助手 conversations
注意
This feature is currently in 公共预览版 and subject to change. During the 公共预览版, this feature is only available to users without enterprise or team memberships.
You can share Copilot 对话助手 conversations from the immersive view (https://github.com/copilot). Shared conversations are public or private (i.e. permission-based), depending on the referenced content, for example, a conversation about a private repository. If you share a private conversation, the recipient must have the necessary permissions to view the content.
Once you share a conversation, the conversation and future messages will be visible to anyone with the link.
-
在 GitHub 上的任意页面的右上角,单击搜索栏旁边的 按钮****。
随即将显示 Copilot 对话助手 的完整页面沉浸式模式。
-
After you submit your first prompt, a share button is displayed in the upper right corner.
-
Click Share to open the share dialog.
-
To share the conversation, click Share. This will generate a link to the conversation.
-
To copy the conversation link, click the copy icon. The link is copied to your clipboard.
Sharing feedback about GitHub 中的 GitHub Copilot Chat
注意
向 GitHub 提供有关 Copilot 拉取请求摘要 的反馈的功能取决于企业设置。 有关详细信息,请参阅“管理企业中 Copilot 的策略和功能”。
To give feedback about a particular Copilot 对话助手 response, click either the thumbs up or thumbs down icon at the bottom of each chat response.
To give feedback about Copilot 对话助手 in general, click the ellipsis (...) at the top right of the chat panel, then click Give feedback.