Link GitHub to ChatGPT Deep Research For Code Analysis
A few days ago, a fantastic new ChatGPT feature was unveiled for paying users. Subscribers at the Plus, Pro, and Team tiers can now direct Deep Research to an entire GitHub repository and receive comprehensive analysis reports.
Also: I test a lot of AI coding tools, and this stunning new OpenAI release just saved me days of work
This capability is incredibly useful for quickly getting up to speed on existing codebases. Whether you're acquiring a product, joining a new project, or revisiting your own code after a hiatus, Deep Research can accelerate your understanding of how different sections operate.
This guide will walk you through moving a codebase into GitHub specifically for analysis by ChatGPT Deep Research.
David Gewirtz / Elyse Betters Picaro / ZDNET
Moving My Code into GitHub
To demonstrate, I'll be moving "My Private Site" into GitHub. This is a freemium WordPress plugin I've maintained for about a decade, with around 20,000 active users. WordPress typically uses SVN for version control, so I hadn't previously needed a GitHub repository for this project.
Also: I put GitHub Copilot's AI to the test - its mixed success at coding baffled me
However, the prospect of performing deep analysis on it with ChatGPT was too good to pass up. Here's how I did it.
Getting Started with GitHub Desktop
Before diving in, let's clarify a few terms. Git is a distributed version control system that runs locally on a programmer's computer. GitHub is a cloud-based service that hosts a vast collection of open-source and proprietary coding projects. Projects are moved to GitHub (the service) using Git (the tool).
There's a running joke that "real programmers" only use Git on the command line, never daring to capitalize "git," and reveling in complex command-line options. Failure to do so supposedly results in the revocation of one's "real-programmer card."
Also: How I used GitHub Spark to build an app with just a one-sentence AI prompt
I confess, I am apparently not a "real programmer." I prefer using GitHub Desktop, a point-and-click version of Git. I appreciate graphical user interfaces as tools of modern convenience. My official "real-programmer card" has indeed been revoked, and I can live with that.
You can download GitHub Desktop here.
Once GitHub Desktop is launched, either sign in to your existing GitHub account or create a new one. I already had an account from other projects, so I just signed in.
How to Create a GitHub Repository
Next, I created a repository in the GitHub cloud for my codebase. This part can be a little confusing. Even though I didn't have an existing repo for "My Private Site," I chose "Add an Existing Repository from your Local Drive…" because my plan was to take that local codebase and transform it into a repo.
GitHub Desktop is quite intelligent here. If it detects no existing GitHub data for the selected folder, it will display an error and offer an option to create a repository. Click the link to proceed.
This brings up the "Create a New Repository" dialog. I named my repo (all lowercase, with dashes between words, e.g., my-private-site
), added a brief description, specified the local path to the code, and left the other options at their defaults.
Since this repository is primarily for AI analysis rather than source control and collaboration, I didn't need to configure README, license, or .gitignore files at this stage.
It's important to note that this article focuses on setting up your code for examination by ChatGPT Deep Research, not as a comprehensive guide to all GitHub features.
How to Move the Codebase to GitHub
Now it's time to upload your code to GitHub.
A cautionary note: If your code has been private, uploading it to GitHub means sending it to a cloud service. While GitHub offers both private and public repositories, you are technically granting Microsoft (which owns GitHub) access to your code.
Proceed by clicking "Publish repository."
At this point, you can choose to make your repository public or private. When you connect ChatGPT to your repo, you'll pass along your access rights, allowing ChatGPT to examine a private repository.
Also: How to use ChatGPT: A beginner's guide to the most popular AI chatbot
I encountered some initial issues with Deep Research accessing my code, and ChatGPT inquired if my code was public. My interpretation is that if your code is private and all credentials and connectors are correctly set up (more on this later), working with a private repo should be feasible.
Since "My Private Site" is open source, I unchecked "Keep this code private."
Looking at Your New Repository
If everything proceeded correctly, you'll see a new option: "View on GitHub." Click it.
This will take you to your newly created GitHub repository online. Take note of its designation, found in the upper left corner of the GitHub screen (e.g., davidgewirtz/my-private-site
, without spaces).
How to Set Up the ChatGPT Connection
Now, switch over to ChatGPT. The following steps are similar to those shown in my previous article on the feature.
First, change your model to o3 (likely GPT-4o) and type in the prompt exactly as shown in the original article. While you can experiment, if you have the $20-per-month Plus tier, you're limited to 10 Deep Research queries per month, so precision is key.
Next, click the small caret next to Deep Research.
Also: Want to try ChatGPT's Deep Research tool for free? Check out the lightweight version
Now, create the link between your ChatGPT account and your GitHub account. You'll need to grant the AI permission to access your GitHub account features.
Next, you'll be asked which GitHub account should be connected. If you have multiple accounts, you'll see a choice screen; otherwise, you might bypass this step.
Then, more permissions: grant access to either all your account's repositories or just specific ones. I selected only the my-private-site
repo.
Theoretically, Deep Research in ChatGPT should now be connected to your repository. However, in my case, an additional step was required.
What to Do if ChatGPT Can't Find Your Repo
GitHub indexes repositories. If ChatGPT doesn't show your repository as available, it probably means GitHub hasn't indexed your new repository yet. This happened to me.
I should have been able to select or type in my full repo name (e.g., davidgewirtz/my-private-site
), but ChatGPT couldn't locate it.
Also: I tested ChatGPT's Deep Research against Gemini, Perplexity, and Grok AI to see which is best
To resolve this, go back to your GitHub account and use the search bar to type in a specific command string: repo:your-username/your-repo-name import
. Replace your-username/your-repo-name
with your actual repository details. This command tells GitHub to prioritize indexing your repository.
GitHub should confirm that it's indexing your repository.
I took a coffee break to allow GitHub time to complete the indexing. Afterward, I returned to ChatGPT, opened the Deep Research menu, and my newly created repository was listed and selectable.
Have Fun with Deep Research
You're now ready to use Deep Research on your repository. For a detailed account of how this worked for my project, refer to my earlier article on the topic.
I found the experience quite impressive, and you might too.
Also: 5 reasons I turn to ChatGPT every day - from faster research to replacing Siri
Have you tried using ChatGPT Deep Research with your own code? What was your experience connecting a GitHub repo? Did you encounter any indexing issues or permission snags? Do you prefer GitHub Desktop or the command line for setting up repositories? Share your thoughts in the comments below.
You can follow my day-to-day project updates on social media. Be sure to subscribe to my weekly update newsletter, and follow me on Twitter/X at @DavidGewirtz, on Facebook at Facebook.com/DavidGewirtz, on Instagram at Instagram.com/DavidGewirtz, on Bluesky at @DavidGewirtz.com, and on YouTube at YouTube.com/DavidGewirtzTV.
Get the morning's top stories in your inbox each day with our Tech Today newsletter.