1
0
mirror of synced 2025-12-19 18:10:59 -05:00

New article: Using Copilot to explore a codebase (#56021)

Co-authored-by: Jules <19994093+jules-p@users.noreply.github.com>
This commit is contained in:
hubwriter
2025-06-11 14:42:45 +01:00
committed by GitHub
parent 09fa0b5fea
commit 8fbb97f802
10 changed files with 162 additions and 80 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -26,8 +26,10 @@ You can add custom instructions for {% data variables.copilot.copilot_chat %} in
You can add personal custom instructions either in the Chat panel or in immersive mode. The same instructions will be applied in both modes.
1. In the top right of any page on {% data variables.product.github %}, either:
* Click the **{% octicon "copilot" aria-label="Copilot" %}** icon to open the {% data variables.copilot.copilot_chat_short %} panel.
* Click {% octicon "triangle-down" aria-label="The downwards triangle icon" %} next to the **{% octicon "copilot" aria-label="Copilot" %}** icon, then click **Immersive** to open {% data variables.copilot.copilot_chat_short %} in the full-page, immersive mode. You can also go directly to [https://github.com/copilot](https://github.com/copilot).
* Click the **{% octicon "copilot" aria-label="Copilot" %}** icon to open the full-page, immersive mode of {% data variables.copilot.copilot_chat_short %}.
* Click {% octicon "triangle-down" aria-label="The downwards triangle icon" %} next to the **{% octicon "copilot" aria-label="Copilot" %}** icon, then click **Assistive** to open the {% data variables.copilot.copilot_chat_short %} panel.
1. Select the {% octicon "kebab-horizontal" aria-label="Open conversation options" %} dropdown menu at the top right of the Chat panel, or immersive page, then click **Personal instructions**.
1. Add natural language instructions to the text box.

View File

@@ -69,11 +69,8 @@ You can open {% data variables.copilot.copilot_chat_short %} from any page on {%
Depending on the question you ask, and your enterprise and organization settings, {% data variables.product.prodname_copilot_short %} may respond using information based on the results of a Bing search. By using Bing search, {% data variables.product.prodname_copilot_short %} 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 [AUTOTITLE](/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/managing-copilot-policies-as-an-individual-subscriber#enabling-or-disabling-web-search-for-github-copilot-chat) and [AUTOTITLE](/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise).
1. At the top right of any page on {% data variables.product.github %}, click {% octicon "triangle-down" aria-label="The downwards triangle icon" %} beside the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %}** icon and click **Immersive** in the dropdown menu.
![Screenshot of the 'Immersive' button, highlighted with a dark orange outline.](/assets/images/help/copilot/copilot-immersive-button.png)
1. At the bottom of the page, in the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
{% data reusables.copilot.immersive-mode-instructions %}
1. In the prompt box, type a question and press <kbd>Enter</kbd>.
Some examples of general questions you could ask are:
@@ -84,7 +81,7 @@ Depending on the question you ask, and your enterprise and organization settings
* `Write a bash script to output today's date.`
{% data reusables.copilot.stop-response-generation %}
1. If {% data variables.product.prodname_copilot_short %} uses a Bing search to answer your question, "Using web search results for 'SEARCH QUERY'" is displayed above the response. Click this to see the search results that {% data variables.product.prodname_copilot_short %} used to answer your question.
1. If {% data variables.product.prodname_copilot_short %} 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 {% data variables.product.prodname_copilot_short %} used to answer your question.
1. Within a conversation thread, you can ask follow-up questions. {% data variables.product.prodname_copilot_short %} will answer within the context of the conversation. For example, you could type "tell me more" to get {% data variables.product.prodname_copilot_short %} 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 {% data variables.product.prodname_copilot_short %} provide more relevant answers to your follow-up questions. For more information, see [Prompting {% data variables.copilot.copilot_chat %} to become your personal AI assistant for accessibility](https://github.blog/2023-10-09-prompting-github-copilot-chat-to-become-your-personal-ai-assistant-for-accessibility/) on the {% data variables.product.prodname_dotcom %} Blog.
@@ -95,7 +92,7 @@ Depending on the question you ask, and your enterprise and organization settings
### Regenerating a response with a different model
> [!NOTE]
> This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
> This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change. It is currently not available for all models.
After {% data variables.product.prodname_copilot_short %} responds to your question, you can regenerate the same prompt using a different model by clicking the retry icon ({% octicon "sync" aria-label="The re-run icon" %}) below the response. The new response will use your selected model and maintain the full context of the conversation.
@@ -157,7 +154,7 @@ You can ask {% data variables.copilot.copilot_chat_short %} different types of q
## Asking {% data variables.copilot.copilot_chat_short %} questions in a repository
To ask a question about a specific repository, you must be viewing the repository on {% data variables.product.github %}.
You can ask {% data variables.product.prodname_copilot_short %} about a specific repository:
1. Navigate to a repository on {% data variables.product.github %}.
{% data reusables.copilot.open-chat-panel %}
@@ -166,7 +163,7 @@ To ask a question about a specific repository, you must be viewing the repositor
![Screenshot of the {% data variables.product.prodname_copilot_short %} chat panel opened inside a repository. The specified repository is highlighted with a dark orange outline.](/assets/images/help/copilot/copilot-chat-in-repository.png)
1. At the bottom of the panel, in the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
1. At the bottom of the panel, in the prompt box, type a question and press <kbd>Enter</kbd>.
> [!NOTE]
>
@@ -178,16 +175,11 @@ You can ask {% data variables.product.prodname_copilot_short %} about a specific
> [!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.
1. Navigate to a repository on {% data variables.product.github %}.
{% data reusables.copilot.open-chat-panel %}
1. To select a repository for context, click {% octicon "paperclip" aria-label="Add attachments" %} at the bottom of the chat panel, then select "Repositories".
![Screenshot of the "Attach files or symbols" button, highlighted with a dark orange outline.](/assets/images/help/copilot/chat-paperclip-icon.png)
1. Once the repository has been attached, click {% octicon "paperclip" aria-label="Add attachments" %} again, then select "Files, folders, and symbols".
1. In the prompt box, click **{% octicon "paperclip" aria-label="Add attachments" %} Attach**, then click **Files, folders, and symbols**.
1. Search for and select one or more files, folders, or symbols.
1. In the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
1. In the prompt box, type a question and press <kbd>Enter</kbd>.
{% data variables.product.prodname_copilot_short %} replies in the chat panel.
@@ -203,19 +195,12 @@ Organization owners (with a {% data variables.copilot.copilot_enterprise_short %
When you enter a query, {% data variables.product.prodname_copilot_short %} 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.
1. At the top right of any page on {% data variables.product.github %}, click {% octicon "triangle-down" aria-label="The downwards triangle icon" %} beside the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %}** icon and click **Immersive** in the dropdown menu.
{% data reusables.copilot.immersive-mode-instructions %}
1. To select a knowledge base for context, click **{% octicon "paperclip" aria-label="Add attachments" %} Attach** at the bottom of the chat panel, then click **Knowledge bases**.
1. In the "Select knowledge bases" dialog, type the name of the knowledge base you want to use as context, select the knowledge bases you want to use, and click **Save**.
1. In the prompt box, type a question and press <kbd>Enter</kbd>.
![Screenshot of the 'Immersive' button, highlighted with a dark orange outline.](/assets/images/help/copilot/copilot-immersive-button.png)
1. To select a knowledge base for context, click {% octicon "paperclip" aria-label="Add attachments" %} at the bottom of the chat panel, then select "Knowledge base".
![Screenshot of the "Attach files or symbols" button, highlighted with a dark orange outline.](/assets/images/help/copilot/chat-paperclip-icon.png)
1. In the "Search knowledge bases" box, type the name of the knowledge base you want to use as context, then click the knowledge base in the list of search results.
1. At the bottom of the page, in the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
1. At the bottom of the response, {% data variables.product.prodname_copilot_short %} provides links to the source documentation for additional context.
You can click the **_n_ references** link at the top of the response to see the sources that {% data variables.product.prodname_copilot_short %} used to answer your question.
1. 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.
@@ -240,34 +225,12 @@ You can chat with {% data variables.product.prodname_copilot_short %} about a fi
![Screenshot of the {% data variables.product.prodname_copilot_short %} buttons, highlighted with a dark orange outline, to the right of some selected code.](/assets/images/help/copilot/copilot-buttons-inline-code.png)
1. If you clicked the {% data variables.product.prodname_copilot_short %} icon, type a question in the "Ask {% data variables.product.prodname_copilot_short %}" box at the bottom of the chat panel and press <kbd>Enter</kbd>.
1. If you clicked the {% data variables.product.prodname_copilot_short %} icon, type a question in the prompt box at the bottom of the chat panel and press <kbd>Enter</kbd>.
{% data variables.product.prodname_copilot_short %} responds to your request in the panel.
![Screenshot of a response to the question "What does the function at the selected lines do?"](/assets/images/help/copilot/copilot-sample-chat-response.png)
## Asking questions about alerts from {% data variables.product.prodname_GHAS %} products
{% data variables.product.prodname_copilot_short %} allows you to use natural language questions to ask about security alerts in repositories in your organization when these alerts are generated by {% data variables.product.prodname_GHAS %} features ({% data variables.product.prodname_code_scanning %}, {% data variables.product.prodname_secret_scanning %}, and {% data variables.product.prodname_dependabot_alerts %}).
1. At the top right of any page on {% data variables.product.github %}, click {% octicon "triangle-down" aria-label="The downwards triangle icon" %} beside the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %}** icon and click **Immersive** in the dropdown menu.
![Screenshot of the 'Immersive' button, highlighted with a dark orange outline.](/assets/images/help/copilot/copilot-immersive-button.png)
1. To select a repository for context, click {% octicon "paperclip" aria-label="Add attachments" %} at the bottom of the chat panel, then select "Repositories".
![Screenshot of the "Attach files or symbols" button, highlighted with a dark orange outline.](/assets/images/help/copilot/chat-paperclip-icon.png)
1. In the "Search repositories" box, type the name of the repository you want to ask about, then click the repository in the list of search results.
1. In the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
<a id="repo-indexing-note"></a>
> [!TIP]
>
> {% data reusables.copilot.semantic-index-info %}
## Asking questions about a specific pull request
You can ask {% data variables.product.prodname_copilot_short %} different questions about a pull request, from different views within the pull request. For example, you can ask {% data variables.product.prodname_copilot_short %} to summarize a pull request, or explain what has changed within specific files or lines of code in a pull request.
@@ -277,14 +240,14 @@ You can ask {% data variables.product.prodname_copilot_short %} different questi
1. On {% data variables.product.github %}, navigate to a pull request in a repository.
{% data reusables.copilot.open-chat-panel %}
{% data reusables.copilot.chat-previous-conversation %}
1. At the bottom of the {% data variables.copilot.copilot_chat_short %} panel, in the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
1. At the bottom of the {% data variables.copilot.copilot_chat_short %} panel, in the prompt box, type a question and press <kbd>Enter</kbd>.
### Ask about changes to a specific file in a pull request
1. On {% data variables.product.github %}, navigate to a pull request in a repository.
1. Click the **Files changed** tab.
1. Click {% octicon "kebab-horizontal" aria-label="Show options" %} at the top right of the file, then click **Ask {% data variables.product.prodname_copilot_short %} about this diff**.
1. Type a question in the "Ask {% data variables.product.prodname_copilot_short %}" box at the bottom of the chat panel and press <kbd>Enter</kbd>.
1. Type a question in the prompt box at the bottom of the chat panel and press <kbd>Enter</kbd>.
### Ask about specific lines within a file in a pull request
@@ -301,9 +264,9 @@ You can ask {% data variables.product.prodname_copilot_short %} different questi
1. Scroll to the bottom of the page, then, next to one of the failing checks, click **Details**.
{% data reusables.copilot.open-chat-panel %}
{% data reusables.copilot.chat-previous-conversation %}
1. At the bottom of the {% data variables.copilot.copilot_chat_short %} panel, in the "Ask {% data variables.product.prodname_copilot_short %}" box, ask {% data variables.product.prodname_copilot_short %} why the pull request has failed and press <kbd>Enter</kbd>.
1. At the bottom of the {% data variables.copilot.copilot_chat_short %} panel, in the prompt box, ask {% data variables.product.prodname_copilot_short %} why the pull request has failed and press <kbd>Enter</kbd>.
{% data variables.product.prodname_copilot_short %} will respond with information about why the pull request failed. {% data variables.product.prodname_copilot_short %} may also provide suggestions for how to fix the issue.
{% data variables.product.prodname_copilot_short %} responds with information about why the pull request failed. {% data variables.product.prodname_copilot_short %} may also provide suggestions for how to fix the issue.
1. If {% data variables.product.prodname_copilot_short %} has provided steps to fix the issue, you can follow the steps to resolve the problem.
@@ -316,7 +279,7 @@ You can ask {% data variables.product.prodname_copilot_short %} to summarize or
1. Navigate to an issue or discussion on {% data variables.product.github %}.
{% data reusables.copilot.open-chat-panel %}
{% data reusables.copilot.chat-previous-conversation %}
1. At the bottom of the {% data variables.product.prodname_copilot_short %} chat panel, in the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
1. At the bottom of the {% data variables.product.prodname_copilot_short %} chat panel, in the prompt box, type a question and press <kbd>Enter</kbd>.
{% data variables.product.prodname_copilot_short %} responds to your request in the panel.
@@ -329,7 +292,7 @@ You can ask {% data variables.product.prodname_copilot_short %} to explain the c
1. Navigate to a commit on {% data variables.product.github %}.
{% data reusables.copilot.open-chat-panel %}
{% data reusables.copilot.chat-previous-conversation %}
1. At the bottom of the {% data variables.product.prodname_copilot_short %} chat panel, in the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
1. At the bottom of the {% data variables.product.prodname_copilot_short %} chat panel, in the prompt box, type a question and press <kbd>Enter</kbd>.
> [!TIP]
> If you know the SHA for a commit, instead of navigating to the commit, you can ask {% data variables.product.prodname_copilot_short %} about the commit from any page in the repository on {% data variables.product.github %} by including the SHA in your message. For example, `What changed in commit a778e0eab?`
@@ -395,11 +358,14 @@ You can ask {% data variables.product.prodname_copilot_short %} a question about
You can access {% data variables.product.prodname_copilot_short %}'s immersive view from the dashboard. The dashboard is your personalized overview of your activity on {% data variables.product.github %}, seen when you visit https://github.com while logged in.
1. Go to the dashboard at [https://github.com](https://github.com).
1. In the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and press <kbd>Enter</kbd>.
1. In the prompt box, type a question and press <kbd>Enter</kbd>.
![Screenshot of the dashboard with the "Ask Copilot" box highlighted with an orange outline.](/assets/images/help/copilot/copilot-chat-dashboard.png)
You will be taken to the immersive view where {% data variables.product.prodname_copilot_short %} will respond to your request.
You will be taken to the immersive view where {% data variables.product.prodname_copilot_short %} responds to your request.
> [!NOTE]
> If you don't see the {% data variables.copilot.copilot_chat_short %} prompt box on your dashboard, check that **Dashboard entry point** in enabled in your {% data variables.product.prodname_copilot %} settings.
## Extending {% data variables.copilot.copilot_chat_dotcom_short %}
@@ -413,9 +379,9 @@ You can share {% data variables.copilot.copilot_chat_short %} conversations from
Once you share a conversation, the conversation and future messages will be visible to anyone with the link.
1. In the top right of any page on {% data variables.product.github %}, click the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %}** {% data variables.product.prodname_copilot %} icon next to the search bar.
1. To view a conversation in immersive mode, click **{% octicon "screen-full" aria-hidden="true" aria-label="screen-full" %} Immersive**.
1. Once you submit your first prompt, a share button will appear in the upper right corner. Click **{% octicon "lock" aria-hidden="true" aria-label="lock" %} Share** to open the share dialog.
{% data reusables.copilot.immersive-mode-instructions %}
1. After you submit your first prompt, a share button is displayed in the upper right corner.
1. Click **{% octicon "lock" aria-hidden="true" aria-label="lock" %} Share** to open the share dialog.
![Screenshot of the main search box on {% data variables.product.prodname_dotcom %}. The share button is highlighted with an orange outline.](/assets/images/help/copilot/chat-share-button.png)
@@ -432,5 +398,6 @@ To give feedback about {% data variables.copilot.copilot_chat_short %} in genera
## Further reading
* [AUTOTITLE](/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide).
* [AUTOTITLE](/copilot/using-github-copilot/asking-github-copilot-questions-in-github-mobile).
* [AUTOTITLE](/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide)
* [AUTOTITLE](/copilot/using-github-copilot/asking-github-copilot-questions-in-github-mobile)
* [AUTOTITLE](/copilot/using-github-copilot/guides-on-using-github-copilot/using-copilot-to-explore-a-codebase)

View File

@@ -15,22 +15,22 @@ The use of AI tools is increasingly becoming a standard part of a software devel
{% data variables.product.github %}'s AI tools assist with every phase of the software development lifecycle (SDLC):
* **Planning**:
* {% data variables.product.prodname_copilot_short %} can create issues to help track your ideas.
* {% data variables.copilot.copilot_chat_short %} can help you brainstorm and identify the best technologies for your project.
* **{% data variables.copilot.copilot_chat_short %}** can help you brainstorm and identify the best technologies for your project.
* **{% data variables.copilot.copilot_chat_short %}** can create issues to help track your ideas.
* **Code creation**:
* {% data variables.product.prodname_copilot_short %} code completion helps add code as you type.
* {% data variables.copilot.next_edit_suggestions_caps %} ({% data variables.release-phases.public_preview %}) predicts the next edit you are likely to make and suggests a completion for it.
* {% data variables.copilot.copilot_chat_short %} can answer questions and offer suggestions in a conversational environment.
* You can assign {% data variables.copilot.copilot_coding_agent %} to an open issue and it will automatically raise a pull request to address the necessary changes.
* **{% data variables.product.prodname_copilot_short %} code completion** helps add code as you type.
* **{% data variables.copilot.next_edit_suggestions_caps %}** ({% data variables.release-phases.public_preview %}) predicts the next edit you are likely to make and suggests a completion for it.
* **{% data variables.copilot.copilot_chat_short %}** can answer questions and offer suggestions in a conversational environment.
* You can assign **{% data variables.copilot.copilot_coding_agent %}** to an open issue and it will automatically raise a pull request to address the necessary changes.
* **Reviews**:
* {% data variables.copilot.copilot_code-review_short %} gives you feedback in your favorite IDE, or as a pull request review on {% data variables.product.github %}.
* **{% data variables.copilot.copilot_code-review_short %}** gives you feedback in your favorite IDE, or as a pull request review on {% data variables.product.github %}.
* **Testing**:
* {% data variables.copilot.copilot_chat_short %} can help you write and debug tests.
* **{% data variables.copilot.copilot_chat_short %}** can help you write and debug tests.
* **Deployment**:
* {% data variables.copilot.copilot_chat_short %} can help you configure continuous integration and continuous deployment (CI/CD) pipelines.
* **{% data variables.copilot.copilot_chat_short %}** can help you configure continuous integration and continuous deployment (CI/CD) pipelines.
* **Operation**:
* {% data variables.copilot.copilot_coding_agent %} ({% data variables.release-phases.public_preview %}) can raise pull requests for open issues.
* {% data variables.copilot.copilot_chat_short %} can help with tasks you're working on yourself.
* **{% data variables.copilot.copilot_coding_agent %}** ({% data variables.release-phases.public_preview %}) can raise pull requests for open issues.
* **{% data variables.copilot.copilot_chat_short %}** can help with tasks you're working on yourself.
## Planning

View File

@@ -9,10 +9,11 @@ topics:
redirect_from:
- /copilot/using-github-copilot/example-use-cases
children:
- /choosing-the-right-ai-tool-for-your-task
- /using-copilot-to-explore-a-codebase
- /refactoring-code-with-github-copilot
- /using-copilot-to-migrate-a-project
- /writing-tests-with-github-copilot
- /modernizing-legacy-code-with-github-copilot
- /upgrading-java-projects-with-github-copilot
- /choosing-the-right-ai-tool-for-your-task
---

View File

@@ -0,0 +1,104 @@
---
title: Using Copilot to explore a codebase
shortTitle: Explore a codebase
intro: '{% data variables.copilot.copilot_chat %} can help you gain an understanding of the content, structure, and functionality of a codebase.'
topics:
- Copilot
versions:
feature: copilot
---
## Introduction
If you've been assigned to work on a project that you're not familiar with—or you've found an interesting open source project that you want to contribute to—you'll need some understanding of the codebase before you can start making changes. This guide will show you how to use {% data variables.copilot.copilot_chat %} to explore a codebase and quickly learn about the project.
## Working with {% data variables.copilot.copilot_chat_short %}
Throughout this guide, we'll work on {% data variables.product.prodname_dotcom_the_website %}, using {% data variables.copilot.copilot_chat_short %} in assistive mode, which displays a {% data variables.copilot.copilot_chat_short %} panel over the bottom right corner of your current page on {% data variables.product.prodname_dotcom_the_website %}.
You can expand the {% data variables.copilot.copilot_chat_short %} panel, to give more space for displaying {% data variables.product.prodname_copilot_short %}'s responses, by clicking and dragging the edges of the panel.
## Using the predefined prompts
{% data variables.copilot.copilot_chat_short %} comes with a set of predefined prompts that can help you get started with exploring a codebase. You can use the prompts by clicking a button in the chat panel. The buttons are displayed when you start a new conversation with {% data variables.copilot.copilot_chat_short %}. The selection of prompts varies depending on the currently displayed page on {% data variables.product.prodname_dotcom_the_website %}.
1. Open the repository you want to explore on {% data variables.product.prodname_dotcom_the_website %}.
1. Click the **Code** tab to display the main page of the repository.
1. {% data reusables.copilot.assistive-mode-instructions %}
1. Click the **Tell me about this repository** button in the chat panel.
![Screenshot of the chat panel with the 'Tell me about this repository' button highlighted.](/assets/images/help/copilot/tell-me-about-repo.png)
> [!TIP]
> If this button is not displayed, make sure you are on the main page of the repository and click the plus sign ({% octicon "plus" aria-hidden="true" aria-label="plus" %}) at the top right of the {% data variables.product.prodname_copilot_short %} panel to start a new conversation.
A predefined prompt is submitted to {% data variables.product.prodname_copilot_short %} and the response is displayed in the chat panel.
1. Optionally, after reading the response, click the plus sign ({% octicon "plus" aria-hidden="true" aria-label="plus" %}) at the top right of the {% data variables.product.prodname_copilot_short %} panel to start a new conversation, then click **How to get started with this repository**.
## Example prompts
The following prompts are examples of the kind of questions you can ask {% data variables.product.prodname_copilot_short %} to help you find out about a codebase.
### General questions
<!-- Blank lines left between list items to space out the output slightly. -->
* `Based on the code in this repository, give me an overview of the architecture of the codebase. Provide evidence.`
* `Which languages are used in this repo? Show the percentages for each language.`
* `What are the core algorithms implemented in this repo?`
* `What design patterns are used in this repository? Give a brief explanation of each pattern that you find, and an example of code from this repository that uses the pattern, with a link to the file.`
### Specific questions
Whether these questions are useful will depend on the codebase you're exploring.
* `How do I build this project?`
* `Where is authentication handled in this codebase?`
* `Analyze the code in this repository and tell me about the entry points for this application.`
* `Describe the data flow in this application.`
* `Analyze the code in this repository and tell me what application-level security mechanisms are employed. Provide references.`
## Understanding the files in a directory
Use {% data variables.product.prodname_copilot_short %} to help you understand the purpose of the files in a directory, or individual files.
To find out about the files in a directory:
1. Navigate to the directory on {% data variables.product.prodname_dotcom_the_website %}.
1. {% data reusables.copilot.assistive-mode-instructions %}
1. Ask {% data variables.product.prodname_copilot_short %}: `Explain the files in this directory`.
To find out about a specific file:
1. Open the file on {% data variables.product.prodname_dotcom_the_website %}.
1. {% data reusables.copilot.assistive-mode-instructions %}
1. For a small file, ask {% data variables.product.prodname_copilot_short %}: `Explain this file`.
1. For a large file, ask: `Explain what this file does. Start with an overview of the purpose of the file. Then, in appropriately headed sections, go through each part of the file and explain what it does in detail.`
## Finding out about commits
One good way to familiarize yourself with a project is to look at the recent work that's been happening. You can do this by browsing the recent commits.
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.navigate-to-commit-page %}
1. Click a commit message to display a diff view for that commit.
1. In the {% data variables.copilot.copilot_chat_short %} panel, enter: `What does this commit do?`.
1. If necessary, you can follow up by entering: `Explain in more detail`.
## Using the Insights tab
In addition to using {% data variables.product.prodname_copilot_short %} to help you become familiar with a project, you can also use the **Insights** tab on {% data variables.product.prodname_dotcom_the_website %}. This gives you a high-level overview of the repository.
For more information, see [AUTOTITLE](/repositories/viewing-activity-and-data-for-your-repository/using-pulse-to-view-a-summary-of-repository-activity) and [AUTOTITLE](/repositories/viewing-activity-and-data-for-your-repository/viewing-a-projects-contributors).
## Further reading
* [AUTOTITLE](/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github)

View File

@@ -38,6 +38,10 @@ When youre exploring a project, you might want to understand the contents of
{% data reusables.copilot.chat-about-specific-lines %}
## Further reading
* [AUTOTITLE](/copilot/using-github-copilot/guides-on-using-github-copilot/using-copilot-to-explore-a-codebase)
## Next steps
Now that you know how to use {% data variables.product.prodname_copilot_short %} to explore projects, you can use it to help you understand any repository, file, or line of code on {% data variables.product.prodname_dotcom %}.

View File

@@ -0,0 +1 @@
Press <kbd>Shift</kbd>+<kbd>C</kbd> to open {% data variables.copilot.copilot_chat_short %} in assistive mode.

View File

@@ -0,0 +1,3 @@
1. At the top right of any page on {% data variables.product.github %}, click the **{% octicon "copilot" aria-label="Copilot icon" %}** button next to the search bar.
The full-page, immersive, mode of {% data variables.copilot.copilot_chat_short %} is displayed.

View File

@@ -1 +1 @@
1. At the top right of the page, click the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %}** {% data variables.product.prodname_copilot %} icon next to the search bar.
1. At the top right of the page, click {% octicon "triangle-down" aria-label="The downwards triangle icon" %} next to the **{% octicon "copilot" aria-label="Copilot" %}** icon, then click **Assistive** to open the {% data variables.copilot.copilot_chat_short %} panel.