Skip to main content

Using GitHub Copilot Chat in GitHub.com

You can use Copilot Chat to answer general questions about software development, or specific questions about the code in a repository.

Who can use this feature?

GitHub Copilot Chat in GitHub.com is part of the GitHub Copilot Enterprise beta. Functionality and documentation are subject to change. You can nominate an enterprise for the beta using the GitHub Copilot Enterprise waitlist form. For more information, see "About GitHub Copilot Enterprise."

Overview

GitHub Copilot Chat is a chat interface that lets you ask and receive answers to coding-related questions either on GitHub.com or within a supported IDE. For information on using GitHub Copilot Chat in an IDE, see "Using GitHub Copilot Chat in your IDE."

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 "About GitHub Copilot Chat."

On GitHub.com, you can use Copilot Chat to ask:

Limitations

The following limitations apply to this beta release of GitHub Copilot Chat in GitHub.com:

  • The ability to set a docset as the context of a conversation will only be available to a limited number of customers during the beta of Copilot Enterprise. Docset creation will be available to all beta customers soon.
  • 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. Anyone who gets access to Copilot from the organization that owns a repository can index that repository.
  • 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.

Prerequisites

  • To use the GitHub Copilot Chat beta you must have an active GitHub Copilot subscription. For more information, see "About billing for GitHub Copilot."
  • To use GitHub Copilot Chat in GitHub.com, you must have been granted access to GitHub Copilot Chat as part of GitHub Copilot Enterprise. For more information, see "Enabling GitHub Copilot Enterprise."

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 documentation set.

  1. On any page on GitHub.com, click the GitHub Copilot icon at the top right of the page.

  2. In the Copilot panel, click the immersive mode button (a dashed square) at the top right of the panel.

    Screenshot of the immersive mode button at the top right of the Copilot panel. The button is highlighted with a dark orange outline.

  3. If the page displays a previous conversation you had with Copilot, click New conversation.

  4. On the "Chat with Copilot" page, click General coding chat.

    Screenshot of the main Copilot page with 'General coding chat' highlighted.

  5. At the bottom of the page, 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.
  6. 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.

  7. To jump back into a previous conversation you had with Copilot, click the "Conversation history" icon (a clock face surrounded by a circular arrow) at the top right of the page.

    Screenshot of the "Conversation history" icon, highlighted with a dark orange outline.

  8. To start over, with a new conversation, click New conversation.

    This takes you back to the main Copilot page. You should always start a new conversation if you want to ask a question that's unrelated to the current conversation.

Asking a question with a specific context

You can choose a specific context, such as a particular repository or a documentation set (docset), and then ask a question with that context in mind. Organization owners can create organization-visible docsets from repositories within their organization. Organization members can then set those docsets as the context for GitHub Copilot Chat in GitHub.com. For more information, see "Creating private docsets."

  1. On any page on GitHub.com, click the GitHub Copilot icon at the top right of the page.

  2. In the Copilot panel, click the immersive mode button (a dashed square) at the top right of the panel.

    Screenshot of the immersive mode button at the top right of the Copilot panel. The button is highlighted with a dark orange outline.

  3. If the page displays a previous conversation you had with Copilot, click New conversation.

  4. Click a docset or a repository to provide a context for your question.

    For example, you could choose a repository whose code you want to understand better, or the documentation for a technology you want to learn more about.

    You can search for a docset or repository, if you don't see one you want to use.

  5. At the bottom of the page, in the "Ask Copilot" box, type a question and press Enter.

    For example, if you chose the repository you are working in as the context, you could ask:

    • What is the main purpose of this repo? What problem does it solve or what functionality does it provide?
    • What web frameworks are used in this project?
    • Where is rate limiting implemented in our API?
    • How is the code organized? Explain the project architecture.
    • Are there any specific environment requirements for working on this project?

    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.

    If you get access to Copilot from the organization that owns the repository, and the repository has not been indexed, an Index this repository button is displayed. Click this button to start the indexing process.

    Screenshot showing the 'Index this repository' button highlighted with a dark orange outline.

    If you chose a documentation set as the context - for example, the Azure documentation - you could ask:

    • What advantages does Azure have over other types of cloud storage?
    • How do I block Azure from accessing locations on my network?
    • How can I reduce the cost of a hosted website?
    • How do I enable MFA?
  6. The response typically contains numbered references to files that Copilot used to generate the answer, from the repository or docset you selected. To list the sources that were used, click Search results from DOCSET.

    Screenshot showing an expanded list of source references.

  7. 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.

  8. To display the complete list of references, click the "Reference list" icon at the top right of the page.

    Screenshot of the "Reference list" icon, highlighted with a dark orange outline.

  9. To jump back into a previous conversation you had with Copilot, click the "Conversation history" icon (a clock face surrounded by a circular arrow) at the top right of the page.

    Screenshot of the "Conversation history" icon, highlighted with a dark orange outline.

  10. To start over, with a new conversation, click New conversation.

    This takes you back to the main Copilot page. You should always start a new conversation if you want to ask a question that's unrelated to the current conversation.

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.

  1. On GitHub.com, navigate to a repository and open a file.

  2. 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.

      Screenshot of the Copilot button, highlighted with a dark orange outline, at the top of the file view.

    • To ask a question about specific lines within the file:

      1. 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.
      2. 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.
      3. To ask a predefined question, click the downward-pointing button beside the Copilot icon, then choose one of the options.

      Screenshot of the Copilot buttons, highlighted with a dark orange outline, to the right of some selected code.

  3. 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.

    Screenshot of a response to the question "What does the function at the selected lines do?"

  4. 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.

  5. 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.

  6. To view a conversation in immersive mode, displaying just the conversation thread, click the dashed box icon at the top right of the conversation thread.

    Screenshot of the immersive mode button at the top right of the Copilot panel. The button is highlighted with a dark orange outline.

Sharing feedback about GitHub Copilot Chat in GitHub.com

To give feedback about a particular Copilot Chat response:

  1. Click either the thumbs up or thumbs down icon at the bottom of each chat response.

  2. Optionally, provide information about why you liked or disliked the response.

    Screenshot of the feedback form for Copilot Chat.

  3. Click Submit feedback.

To give feedback about Copilot Chat in general, click the "Give feedback" link at the top right of any Copilot page on GitHub.com.