6 min · +100 XP
GitHub, only when you need it
What it is for, and how Claude sets it up from two requests.
By the end of this lesson
You will be able to put a project into a private GitHub repository with one request to Claude.
Git and GitHub are often confused. Git is a program on your computer that remembers every saved version of your project; you met it in the Git lesson of the basics module. GitHub is a website that keeps a copy of that history online.
GitHub stores your project in the cloud, remembers every past version, and lets other people work on it with you. For your first tools on your own computer you do not need it.
When you do need it
- 1You want a copy of the project that survives if your computer is lost.
- 2Someone else will work on the project with you.
- 3You want to publish pages with GitHub Pages (free for public repositories).
- 4You want Claude Code's cloud features, such as sessions in the browser or cloud scheduled tasks; they work with GitHub repositories.
A private repository is visible only to you and the people you invite. For personal projects choose private. Before the first upload, make sure .env with your keys is listed in .gitignore; ask Claude to check it.
Set it up with two requests
“Install the GitHub CLI (gh) for me and help me sign in to my GitHub account. Tell me what to click in the browser.”
Claude installs gh the right way for your system and starts the sign-in. You confirm a one-time code on a page in the browser; if a step needs your answer in the terminal, Claude tells you what to choose. You need a free GitHub account.
“Create a private GitHub repository called budget-tool for this project and push it. Check first that .env is in .gitignore, and give me the link.”
Claude checks the project, creates the repository and uploads it.
In teams, changes usually go through a pull request: the changes are made on a separate branch, and a request to merge them lets someone review them first. Claude creates the branch and opens the pull request when you ask. For a personal project you can skip this and work directly.
“Make this change on a new branch and open a pull request, so I can review it on GitHub before merging. Give me the link.”
Claude commits on the branch, pushes it and opens the pull request with a short description.
You do not. Build first, and let Claude handle commits and pushes when you ask. Add GitHub on the day you have one of the reasons above.
The docs recommend gh over a GitHub MCP server: it is more context-efficient, and Claude already knows how to use it for issues, pull requests and review comments. Ask Claude to work on a branch per change and open a pull request, then review the diff on GitHub. Running Claude inside GitHub Actions and answering @claude mentions are covered in the module "Automation for Power Users".
What is the difference between Git and GitHub?
Facts checked against the official Claude Code docs October 24, 2026 · source

Author
Evgenii Arsentev
PhD · Chief Executive Officer, digital health