How to Use GitHub in ChatGPT
Read, review, and reason over real repositories from ChatGPT — code, PRs, issues, commits.
Who this guide is for
Engineers and product folks who want ChatGPT to see actual code context — not paraphrased snippets — when reviewing pull requests, understanding a codebase, or triaging issues.
Why use GitHub inside ChatGPT
GitHub inside ChatGPT is the difference between asking the model a general programming question and asking it about your specific code. Hook it to the right repo and you can review a PR, summarize unfamiliar code, or triage open issues with full file-level context instead of pasting snippets back and forth.
Before you start
- A GitHub account with access to the repositories you want to query.
- GitHub admin approval if connecting to org-owned repos — many orgs gate third-party access.
- An understanding of public vs private repos. The integration honors GitHub's existing permission model — it can read only what you can read.
Step-by-step: using GitHub inside ChatGPT
- Step 1
Connect GitHub
From the app picker, select GitHub. The OAuth flow asks which orgs and repos to grant access to. For most use cases, start with read access; write scopes (creating issues, commenting on PRs) come later.
- Step 2
Review a pull request
Point at a specific PR and ask for a focused review. The model has the full diff plus surrounding file context.
Try this promptReview PR #1247 in our main repo. Focus on whether the new caching layer introduces any race conditions and whether the test coverage is adequate.
What to expectA structured review with specific file:line callouts, concerns enumerated, and a final recommendation (approve / request changes / further investigation).
- Step 3
Understand a codebase you didn't write
Onboarding to a new repo? Ask the integration to explain it.
Try this promptI'm new to this codebase. Walk me through how authentication works — entry points, middleware, session handling, token rotation.
What to expectA narrative explanation grounded in actual files, with code snippets and file paths cited.
- Step 4
Triage open issues
Filter and summarize the issue backlog.
Try this promptList all open issues tagged 'bug' that haven't been updated in 30 days. Cluster them by likely root area and propose owners.
What to expectA clustered list with proposed owners and a short rationale per cluster.
- Step 5
Write actions: be careful
With write scopes the integration can comment on PRs, create issues, even open draft PRs. Treat writes like you would treat any junior teammate's first action — confirm and review.
Common pitfalls
- Granting org-wide access when a single repo would do. GitHub's scope granularity is your friend here.
- Trusting code reviews without your own eyes on the diff. The model is a useful first-pass; the merge call is yours.
- Letting the model open issues / PRs without confirmation. Spam in a real repo's issue tracker is annoying.
Related on ChatGPTAppsRank
Frequently asked questions
- Does it work with private repos?
- Yes if you grant access. The integration honors GitHub's existing permission model — no access to repos you can't already see.
- Can it create PRs?
- With write scopes, it can create draft PRs and commit suggestions. Treat any in-chat PR creation as you would a teammate's draft — review before merging.
- Is my code used for training?
- Review OpenAI's connector data policy and your GitHub plan's terms. Enterprise plans typically have stronger no-training commitments.