GitHub
Last modified: 10 August 2022GitHub Settings: Settings/Preferences | Version Control | GitHub
Required plugins: Git and GitHub (bundled and enabled by default)
IntelliJ IDEA 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.
Register a GitHub account
To be able to retrieve data from a repository hosted on GitHub, or share your projects, you need to register your GitHub account in IntelliJ IDEA.
note
If you do not want to specify your credentials each time you sync with a remote, or push your commits, you can configure IntelliJ IDEA to save your account information (see Configure a password policy).
Register an existing account
Press Ctrl+Alt+S to open the IDE settings and select Version Control | GitHub.
Click
.
In the dialog that opens, specify your GitHub server URL (either github.com, or an enterprise instance).
Do one of the following:
If you already have a token, click the Use Token link and paste it there.
If you want to obtain a new token, enter your login and password. 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. See Creating a personal access token for more details on GitHub tokens.
The token must have the repo, the gist and the read:org scopes enabled in your account permissions (see Understanding scopes).
Create a new GitHub account
Press Ctrl+Alt+S to open the IDE settings and select Version Control | GitHub.
Click Add account, and in the dialog that opens, click Sign up for Github.
Register your account on the Sign up for GitHub page that opens.
Return to the IntelliJ IDEA settings and specify your credentials.
Manage multiple accounts
You can use multiple GitHub accounts in IntelliJ IDEA: for example, a personal account to work on an open-source project, and a corporate account for your main job.
Press Ctrl+Alt+S to open the IDE settings and 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, IntelliJ IDEA 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!