With the Git integration enabled, you can perform basic Git operations from inside IntelliJ IDEA.
The information provided in the topics listed below assumes that you are familiar with the basics of Git version control system.
In this section:
- Using Git Integration
- Setting up a Local Git Repository
- Adding Files to a Local Git Repository
- Adding Tags
- Committing Changes to a Local Git Repository
- Managing Remotes
- Handling Passwords for Git Remote Repositories
- Fetching Changes from a Remote Git Repository
- Pulling Changes from the Upstream (Git Pull)
- Pushing Changes to the Upstream (Git Push)
- Checking Git Project Status
- Managing Branches
- Stashing and Unstashing Changes
- Handling LF and CRLF Line Endings
Prerequisites
- Git
is installed on your computer.
It is strongly recommended that you use version 1.7.1.1 or higher.
- The location of the Git executable file is correctly specified on the Git page of the Settings dialog box.
- Git integration is enabled for the current project root or directory.
- If you are going to use a remote repository, create a Git hosting account first.
You can access the remote repository through the username/password and keyboard interactive authentication methods supported by the Git integration
or through a pair of
sshkeys.Please note the following:
-
sshkeys are generated outside IntelliJ IDEA. You can follow the instructions from https://help.github.com/articles/generating-ssh-keys/
or look for other guidelines.
-
Store the
sshkeys in the home_directory
\.ssh\folder. The location of the home directory
is defined through environmental variables
:
-
HOMEfor Unix-like
operating systems. -
userprofilefor the Microsoft Windows operating system.
-
-
Make sure, the keys are stored in files with correct names:
-
id_rsafor the private key. -
id_rsa.pubfor the public key.
-
- IntelliJ IDEA supports a standard method of using multiple
sshkeys, by means of creating.ssh/configfile.
-
Git support
- When Git integration with IntelliJ IDEA is enabled, the item appears on the menu, and on the context menus of the Editor and Project views.
- The files in the folders under the Git control are highlighted according to their status. See File Status Highlights for file status highlighting conventions.
- Modifications results are shown in the Version Control tool window.
- When using Git integration, it is helpful to open the Version Control tool window.
The Console tab displays the following data:
- All commands generated based on the settings you specify through the IntelliJ IDEA user interface.
- Information messages concerning the results of executing generated Git commands.
- Error messages.