OpenAI

Connecting GitHub to ChatGPT

Connect GitHub to ChatGPT to analyze, search, and cite code using supported live repository access.

Updated: 8 hours ago

Overview

Connect GitHub to ChatGPT to ask questions about your code.

When GitHub is connected, ChatGPT can retrieve permitted repository content on demand, including code, README files, and other documentation. Available experiences can include standard chat, deep research, or agent workflows, depending on your plan and product surface. This live access does not create a synced GitHub index.

GitHub availability can vary by plan, workspace, and product surface. An account may be able to use GitHub in deep research or agent mode even when GitHub is not available in standard chat. For research workflows, see: Deep research in ChatGPT.

Connect GitHub to ChatGPT

To connect GitHub, open Apps or Plugins as available and select GitHub or the plugin that includes it. For account connection steps, see: Connecting and managing app accounts in ChatGPT.

From there, you’ll be directed to GitHub to install and authorize the ChatGPT app, then select the repositories ChatGPT can access. ChatGPT retrieves permitted repository content on demand. GitHub sync and individually configured repository indexing are not available.

To change repository access:

  1. Open Settings.

  2. Select Apps or Plugins, depending on what is available.

  3. Open GitHub.

  4. Select the available repository-management option.

To disconnect GitHub, open the same app settings and select Disconnect.

Create a task from GitHub pull request activity

Eligible users can create an event-triggered (webhook-based) task in Work for activity in a connected github.com repository. Supported activity can include a pull request being opened, marked ready for review, or closed. Depending on the trigger, you can also monitor pull request reviews, comments, commit updates, or completed merges.

The task can access only repositories authorized for the connected GitHub account. Self-hosted GitHub Enterprise connections are not supported for event-triggered tasks.

Share a scheduled task that uses GitHub

When scheduled task sharing is available for your account, you can share an eligible scheduled task whose instructions refer to GitHub. Eligible recipients can create a separate task by connecting their own GitHub account. Their account must have permission to access any repositories their copy requires.

A shared task link does not transfer your GitHub connection, credentials, repository access, or repository files. The task instructions are visible in the shared link, so remove sensitive code or repository information before sharing. Existing GitHub admin approvals and read-only app restrictions still apply.

Event-triggered GitHub tasks can be shared. Eligible recipients must connect their own GitHub account and authorize access to the github.com repositories their task requires.

For more information, see: Scheduled tasks in ChatGPT.

Find missing GitHub repositories

Repositories generally take about 5 minutes to appear as available in ChatGPT.

Additional reasons why you may not see a repository yet:

  • A private or newly created repository may not appear until the GitHub app is installed for the correct account or organization and has access to that repository. Open the GitHub app’s repository settings and confirm that the repository is selected and approved. If GitHub appears connected but no repositories are available, check these settings before reconnecting.

  • Your GitHub organization may require an administrator to approve the ChatGPT app or a specific repository. Review the GitHub app’s repository settings and request access through the approval flow shown for your organization.

  • GitHub’s own search index can take time to include a new repository. This is separate from ChatGPT app sync: GitHub access in ChatGPT retrieves authorized repository content on demand and does not create an administrator-managed GitHub index.

Data and privacy

How ChatGPT works with GitHub

ChatGPT forms search queries from your prompts to find relevant information in your connected GitHub repositories and sends these queries to GitHub. For example, if you ask, “Can you show me where I handled file uploads in the backend?” ChatGPT might search your GitHub repositories using a query like “file upload handler backend.” If needed, it may do a few different searches to find the most relevant code or files.

Understand model training and GitHub data

By default, content sent by customers using business offerings—such as ChatGPT Business, Enterprise, Edu, and our API—is not used to improve our models. For information about how OpenAI uses business data, see: Enterprise Privacy.

For eligible personal-account content, model improvement depends on your Improve the model for everyone setting. For account controls and connected-app privacy, see: Data sharing and privacy for apps in ChatGPT.

ChatGPT data residency applies only to supported, in-scope customer content for the workspace’s selected region. Information sent to GitHub is also subject to GitHub’s own storage, processing, and data-residency terms. For current coverage, see: Data residency and inference residency for ChatGPT.

FAQ

How can GitHub admins approve the ChatGPT app?

If your organization restricts OAuth app access, an organization owner can follow GitHub’s instructions for approving OAuth apps for your organization. Installing the GitHub app and granting it repository access are separate steps.

How do I search for individual files in a repository?

The repository selector searches repository names, not files within a repository. In a supported ChatGPT experience with GitHub connected, you can ask ChatGPT to search an authorized repository using a file name, function name, or error message. Include the repository name and, if you know it, the file path.

Can I disallow specific repositories from being accessed by the ChatGPT app?

Yes. Repository access is controlled in GitHub. Organization owners can review installed GitHub Apps to change which repositories the app can access.

Can I push code, updates, or PRs to GitHub once I connect to ChatGPT?

The GitHub app in ChatGPT only lets you read from your repositories to analyze and search your code. To generate, edit, and push code directly to GitHub, use Codex. For more information, see: Codex Help Center article.

What if I have IP Allow List enabled on GitHub?

If IP Allow List is enabled for your GitHub enterprise or organization, add OpenAI's egress IP blocks to the IP Allow List.

Why is GitHub available in deep research or agent mode but not in chat?

GitHub availability can vary by ChatGPT plan and product experience. Some plans may support GitHub in deep research or agent mode but not in standard chat. If you do not see GitHub in standard chat, check your ChatGPT plan details.

Was this article helpful?