GitHub
GitHub Settings: Settings | Version Control | GitHub
Required plugins: Git and GitHub (bundled and enabled by default)
PyCharm lets you manage Git projects hosted on GitHub directly from the IDE: clone repositories, share your projects, create forks, share code through gists, create pull requests and review incoming pull requests.
To be able to retrieve data from a repository hosted on GitHub, or share your projects, you need to register your GitHub account in PyCharm.
note
If you do not want to specify your credentials each time you sync with a remote, or push your commits, you can configure PyCharm to save your account information (refer to Configure a password policy).
Press CtrlAlt0S to open settings and then select Version Control | GitHub.
Click .
Select Log In via GitHub.
Enter your GitHub credentials in the browser window that opens. If you have two-factor authentication enabled, you will be asked to enter a code that will be sent to you by SMS or through the mobile application.
Press CtrlAlt0S to open settings and then select Version Control | GitHub.
Click .
Select Log In with Token.
Do one of the following:
If you already have a token, insert it in the Add GitHub Account dialog window:
If you want to obtain a new token, click Generate.
Enter your GitHub credentials in the browser window that opens. If you have two-factor authentication enabled, you will be asked to enter a code that will be sent to you by SMS or through the mobile application.
In the token generation page, make sure that the repo, the gist and the read:org scopes are enabled (refer to Understanding scopes).
Click Generate token, copy the token, and paste it into the Add GitHub Account dialog window.
Click Add Account
See Creating a personal access token for more details on GitHub tokens.
When your token expires, you see the following warning when trying to push changes to the GitHub repository:
Click Use Token.
Do one of the following:
If you already have a token, insert it in the Log In to GitHub dialog window:
If you want to obtain a new token, click Generate.
Enter your GitHub credentials in the browser window that opens. If you have two-factor authentication enabled, you will be asked to enter a code that will be sent to you by SMS or through the mobile application.
In the token generation page, make sure that the repo, the gist and the read:org scopes are enabled (refer to Understanding scopes).
Click Generate token, copy the token, and paste it into the Log In to GitHub dialog window.
Click Log In
Press CtrlAlt0S to open settings and then select Version Control | GitHub.
Click .
Select Log In via GitHub.
In the browser window that opens, click Create an account and complete the registration process on GitHub.
Return to the PyCharm settings, click Cancel, and then repeat steps 2 and 3.
Click Authorize JetBrains in browser.
You can use multiple GitHub accounts in PyCharm: for example, a personal account to work on an open-source project, and a corporate account for your main job.
Press CtrlAlt0S to open settings and then select Version Control | GitHub.
Use the button to add as many accounts as you need.
(Optional) To set an account as a default one for the current project, select it and click . If a default account is set, PyCharm will not ask you to select an account you want to use when you share your project on GitHub, rebase a fork, create a pull request, or create a gist.
tip
If you cannot view pull requests in the IDE, or you get an error when you log in to a GitHub account and perform any git operation, refer to the Operations Against a GitHub Repository Are Failing article for troubleshooting tips.
Thanks for your feedback!