PyCharm

How to Connect PyCharm to GitHub Easily

How to Connect PyCharm to GitHub Easily

To connect PyCharm to GitHub, press Ctrl+Alt+S, open Version Control | GitHub, click Add, and log in through the browser or with a personal access token.

Once the account is registered, the IDE reuses that login when you clone a repository or share a project. Pushing commits goes through it too.

Token scopes changed between versions. JetBrains documentation lists three for PyCharm 2025.3 and six for 2026.1 and 2026.2. The newer ones are workflow, read:user and user:email.

What Do You Need Before Connecting PyCharm to GitHub?

A GitHub account, plus a Git executable that PyCharm can find. That’s all.

PyCharm looks for Git when you clone a repository or put an existing project under version control. If it can’t find the executable, the IDE offers to download Git, according to the PyCharm 2026.2 Help.

If you’d rather have Git installed before you open the IDE, there’s a separate guide on installing Git by hand.

Both settings pages open with Ctrl+Alt+S. Your GitHub accounts live under Version Control | GitHub. The Git path sits under Version Control | Git, in the Path to Git executable field, and the Test button next to it tells you whether that path actually works.

Windows users without Git get a fallback. PyCharm searches WSL2 for Git and uses it from there, and it switches to WSL Git on its own for projects opened through the \\wsl$ path.

To point the IDE at WSL Git manually, click Browse next to Path to Git executable and select the binary through \\wsl$, for example \\wsl$\debian\usr\bin\git.

A wrong path fails the Test check, so run it before you move on to the login.

Why is Python conquering the tech world?

Explore comprehensive Python statistics: market dominance, developer preferences, salary insights, and growth trends across industries.

Discover Python Insights →

Browser Login, Classic Token or Fine-Grained Token: Which Should You Use?

Browser login for most people. It runs on OAuth 2.0, so there is no token to copy and paste.

MethodSteps on your sideWhere it fits
Browser loginSign in at GitHub, authorize JetBrainsPersonal machine, account with two-factor authentication
Classic tokenGenerate on GitHub, paste into PyCharmControlled scopes, GitHub Enterprise
Fine-grained tokenGenerate, grant permissions equal to the classic scopesRepository-limited access, after a test run

Stick with browser login unless the handoff fails or gets blocked on that machine, or you need control over the exact scopes on the token. GitHub Enterprise Server is the other exception, since only classic tokens can access enterprises there, while fine-grained tokens can access organizations owned by an enterprise (GitHub Enterprise Server docs).

GitHub recommends fine-grained tokens over classic ones whenever possible, according to GitHub Docs. JetBrains says fine-grained tokens are not fully supported out of the box, though the IDE does not block them (PyCharm 2026.2 Help).

For PyCharm, I’d go with the IDE vendor’s note. A fine-grained token has to carry permissions equal to the classic scopes, and if one is missing you find out through an error halfway through some task.

A pasted token is token-based authentication in its simplest form, so anyone holding it acts as you. GitHub highly recommends an expiration on every personal access token, and classic tokens carry no mandatory one.

New to Python or just need a quick reference? List comprehensions, built-in functions, and core syntax - including lambda, dict methods, and file I/O - is on one page in the Python Cheat Sheet.

How to Add Your GitHub Account in PyCharm

YouTube player

Open Settings with Ctrl+Alt+S, go to Version Control | GitHub, click Add, then pick Log In via GitHub or Log In with Token.

Log In via GitHub

The whole thing happens in one browser tab.

  1. Press Ctrl+Alt+S and open Version Control | GitHub.
  2. Click Add and select Log In via GitHub.
  3. Sign in on the GitHub page that opens in your browser. Enter the two-factor code if the account asks for one.
  4. Authorize JetBrains when GitHub asks, then return to PyCharm.

GitHub sends the code by SMS or through its mobile app, per the PyCharm 2026.2 Help. If the browser never hands control back to the IDE, switch to the token route below.

Log In with a Personal Access Token

The token route starts from the same menu.

  1. Open Version Control | GitHub with Ctrl+Alt+S.
  2. Click Add and select Log In with Token.
  3. Paste an existing token into the Add GitHub Account dialog. No token yet? Click Generate.
  4. On the browser page that opens, sign in (two-factor code included) and tick the scopes listed in the next section.
  5. Click Generate token on GitHub, copy it, paste it into PyCharm and click Add Account.

GitHub shows the token only once, so copy it before leaving the page. A separate guide walks through getting a GitHub token in detail.

Which Token Scopes Does PyCharm Require?

PyCharm 2026.1 and 2026.2 list six scopes: repo, gist, read:org, workflow, read:user and user:email. Guides written for 2025.3 or earlier list only the first three.

Those original ones are broad. According to GitHub Docs, repo grants full access to public and private repositories, and gist grants write access to gists. The read:org scope is read-only and covers organization membership, organization projects and team membership.

Scope addedWhat it grantsListed since
workflowAdd and update GitHub Actions workflow files2026.1 Help
read:userRead profile data2026.1 Help
user:emailRead email addresses2026.1 Help

The 2025.3 Help shows three scopes (repo, gist, read:org), and the 2026.1 and 2026.2 Help pages show six. GitHub.com and GitHub Enterprise logins use the same list. A fine-grained token that lacks a needed permission raises an error in the IDE (PyCharm 2026.2 Help).

Tick all six on any supported version. The tradeoff is a broader token, so set an expiration on GitHub and replace it when PyCharm shows the expired token warning.

How to Clone a GitHub Repository in PyCharm

Go to Git | Clone, choose GitHub in the dialog, pick the repository, set the Directory and click Clone.

  1. Open Git | Clone. If the Git menu is missing, use VCS | Get from Version Control.
  2. Choose GitHub in the left pane of the dialog.
  3. Log in if prompted: click Use token, paste it in the Token field and click Log In, or click Log In via GitHub.
  4. Select a repository from the list, which covers your account and the organizations it belongs to.
  5. Enter the local folder path in the Directory field.
  6. Click Clone, then Yes to create a project from the sources.
  7. Pick Trust Project or Preview in Safe Mode in the security prompt.

The login also happens inside the dialog, so a first-time clone can skip Settings entirely.

You can also start from File | New | Project from Version Control, or from the Clone button in the left pane of the Welcome screen when no project is open.

PyCharm maps the Git root to the project root automatically. Submodules are cloned too and registered as project roots (PyCharm 2026.2 Help).

The remote needs no setup either. It is named origin, the default name Git gives the remote you cloned from.

Cloning from a terminal works as well, and a general guide to cloning a GitHub repository covers that route.

How to Share an Existing Project on GitHub

Choose Git | GitHub | Share Project on GitHub, fill in the repository name, remote name and description, then click Share.

  1. Open the project you want to publish.
  2. Go to Git | GitHub | Share Project on GitHub. If Version Control Integration is not enabled yet, the path is VCS | Share Project on GitHub.
  3. PyCharm connects with the account you already registered. With none registered, the Login to GitHub dialog opens and asks for a token.
  4. In the Share Project on GitHub dialog, enter the repository name, the remote name and a description. Tick Private if the repository should not be publicly accessible.
  5. Click Share. PyCharm creates the repository and uploads the project sources.

The remote name you type shows up later under Git | Manage Remotes (PyCharm 2026.2 Help).

Before you click Share, add the files you want tracked. In the Commit tool window (Alt+0), expand Unversioned Files, select them and press Ctrl+Alt+A. Anything that should stay local goes into a .gitignore file in the VCS root (right-click in the Project tool window, then New | File).

And decide on visibility now, because the Private tick box sits in the same dialog as the Share button.

A short explainer on how a gitignore file works helps if the patterns are unfamiliar.

HTTPS or SSH for the Remote URL?

HTTPS, using the account you already added, fits most projects. Pick SSH when your team standard is key-based access.

FactorHTTPSSSH
CredentialPersonal access token (Git password login was removed)Key pair, public key added to the GitHub account
SetupLog in to PyCharmGenerate a key, load it into ssh-agent, upload the public key
Behind a firewallWorks through firewalls and proxiesPort 22 can be blocked, SSH over the HTTPS port exists as a workaround
Failure modeExpired tokenGitHub deletes keys unused for a year

All four rows come from GitHub Docs. The last one is easy to miss: an SSH remote that worked last spring can fail this autumn because the key sat idle.

PyCharm has a switch for this. Tick Clone git repositories using ssh in Version Control | GitHub and clones transfer over SSH instead of HTTPS.

The key itself is set up outside the IDE, and a walkthrough on adding an SSH key to your GitHub account covers that part. A passphrase on the key means a prompt on every push, fetch and pull unless ssh-agent holds it.

Where PyCharm Stores HTTPS Credentials

The storage policy is set under Appearance and Behavior | System Settings | Passwords. Native Keychain works on macOS and Linux only. With KeePass, entries go into a c.kdbx file protected by a master password, and Do not save simply forgets everything after a restart.

The Use credential helper option on Version Control | Git hands authentication to Git’s own helpers in the login dialog. GitHub Docs names Git Credential Manager as one such helper.

How to Use Multiple Accounts and GitHub Enterprise

Add each account on Version Control | GitHub and mark one as the default per project. For a company host, use Log In to GitHub Enterprise with the server URL.

The Add button takes as many accounts as you need, say a personal one for open source and a corporate one for work. Set as Default applies to the current project only (PyCharm 2026.2 Help).

With a default set, PyCharm stops asking which account to use when you share a project, rebase a fork, create a pull request or create a gist.

What goes in the Server field depends on where the account is hosted.

HostingServer value
GitHub Enterprise Cloudgithub.com
Enterprise Cloud with data residencyA ghe.com address, such as example.ghe.com
Self-hosted serverThe URL your company uses

Pick Log In to GitHub Enterprise from the Add menu, fill in Server, then supply a token in the Add GitHub Account dialog. A typo in Server points the login at the wrong host, so check that field first when an Enterprise login fails.

Why Does PyCharm Show an Authentication Error, and How Do You Fix It?

The documented causes are an expired token, an organization that has not approved the JetBrains integration, a classic token that is not authorized for single sign-on, and an SSH key GitHub deleted.

SymptomCauseFix
Expired token warning on pushToken passed its expiry dateClick Use Token and supply a new one
403 on organization repositories, pull requests will not loadOrganization has not approved the JetBrains IDE Integration appAuthorize the app on your account, or ask an organization owner to approve it
SAML SSO organization rejects a classic tokenToken not authorized for that organizationAuthorize the token for the organization on GitHub
SSH remote refused after a long gapGitHub deleted a key unused for a yearAdd a new public key to the account

Replacing an expired token takes a minute.

  1. Click Use Token in the expired token warning.
  2. Paste a new token into the Log In to GitHub dialog, or click Generate to get one.
  3. Click Log In.

The PyCharm 2026.2 Help points to a JetBrains support article for failing GitHub operations. That article dates from July 2021, and it lists a personal access token as the workaround for the 403 case.

So when a token works and browser login returns 403, suspect the organization approval, not the token.

The GitHub settings page also carries a Connection timeout field, which sets how long PyCharm waits for a connection to be established.

PyCharm GitHub Integration FAQ

Does PyCharm Community Edition support GitHub?

Yes. JetBrains Help says that starting with PyCharm 2025.1, Community and Professional are combined into one unified product with free core features, and Community 2025.2 was the last standalone release. The 2025.3 quick start guide lists Git (GitHub) among the Get from VCS choices on the Welcome screen.

How do I push changes to GitHub after connecting?

Open the Push dialog with Git | Push or press Ctrl+Shift+K, review the commits and click Push.

Commit and Push in the commit dialog skips ahead, though a setting in Version Control | Git decides whether the Push dialog still appears.

Can I create a GitHub account from inside PyCharm?

Yes, through the browser. Choose Log In via GitHub, click Create an account on the page that opens and finish registration there.

Then return to the PyCharm settings, click Cancel, repeat the login and click Authorize JetBrains.

Is there a way to clone only recent history?

Yes. Tick the shallow clone checkbox in the clone dialog and enter how many commits to fetch.

Pull the rest later with Git | Unshallow Repository.

How can I jump from a file in PyCharm to its GitHub page?

Select Git | GitHub | Open on GitHub, or right-click the file and choose Open In | GitHub. PyCharm opens the copy on the active branch at the latest revision.

From the editor, the page also scrolls to the current line.

How do I add a second remote for a fork?

Go to Git | Manage Remotes, click Add (or press Alt+Insert), then enter the remote name and URL.

This fits a clone you cannot write to, where you push to your own fork instead.

Can I create pull requests from PyCharm?

Yes. PyCharm lists pull requests in a Pull Requests tool window and creates them from the IDE.

A default account set under Version Control | GitHub spares you the account prompt when you create one.

Which PyCharm Git Settings Should You Change First?

A working GitHub integration still leaves a few settings in Version Control | Git worth touching before the first push. The update method comes first, then loading GitHub’s branch protection rules, and the staging area last.

Settle the update method first, Merge or Rebase. With auto-update on and the Push Rejected dialog never shown, PyCharm merges silently (PyCharm 2026.2 Help), and a primer on how Git rebase works helps when linear history matters.

Branch protection comes second. Turn on Load branch protection rules from GitHub, and PyCharm applies those rules and re-syncs them on every fetch.

Enable staging area only if you want it, because it deletes all existing changelists. The gain is separate commits for overlapping changes in one file.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.