Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you make Git work with IntelliJ?

I am going to use Git version control by IntelliJ Community Edition in order to make branches of the programs I intend to develop. I am striving to accustom myself to its functionality and I come accross obstacles.

I follow the instructions of the web-page http://wiki.jetbrains.net/intellij/Using_Git_Locally and although I do what it orders, when I reach Image5 I find an empty list under Default.

It is possible that it does not matter I thought, so I continued the procedure.
However when I come to most important section of Committing Changes to Master (Revision 1) the list is also empty and the commit changes does not detect any changes to my project (see Image13 and Image 14).

Apart from that, I receive a message when I open the project once more indicating that the Git execution path is not correct. But how can I get knowledge of what execution path should be appropriate so as to insert it?

Does anybody know a decent order of instructions (on a web site or by his won experience) which can guide me to how I can take advantage of Git functionality to incorporate it to my work? It is crucial for me to put my work through.

like image 558
arjacsoh Avatar asked Oct 06 '11 07:10

arjacsoh


People also ask

Why Git is not working in IntelliJ?

The issue was that I was using a symlink in my path to the git repo. Fixed by going to "File -> Settings -> Version Control" and editing my project root to use the absolute path.

Do we need to install Git for IntelliJ?

Since Intellij does not come with Git distribution, we need to install it externally (check out our getting started tutorial for Git installation). Open Settings>Version Control>Git (Ctrl+Alt+S) and specify git external path as shown (this is just a one time configuration):

How does Git sync with IntelliJ?

In Git Bash: git push origin master. In IntelliJ IDEA right-click on project select Synchronize 'TestProject' In IntelliJ IDEA right-click on project select Git -> Repository -> Branches -> origin/master -> Checkout as new local branch.


1 Answers

You need to specify the executable path of Git in the Git Settings, as mentionned in the per-requesites:

The Git integration plugin is enabled and the location of the Git executable file is correctly specified on the Git page of the Settings dialog box.

As long as you see "a message indicating that the Git execution path is not correct", the rest of the instructions won't work.

Path to Git executable

In this text box, specify the path to the Git executable file.
Type the path manually or click the Browse button to open the Select Path - Git Configuration dialog box and select the location of the Git executable file in the directories tree.

See "Where is git.exe located?" for the path of Git on Windows.

  • with Git for Windows:

      C:\Program Files\Git\mingw64\bin 

OR

    c:\path\to\PortableGit-2.6.2-64-bit\usr\bin 

OR

    c:\path\to\PortableGit-2.x.\mingw64\bin 
  • With GitHub Desktop:

      %USERPROFILE%\AppData\Local\GitHub\PORTAB~1\bin\git.exe 

Update 2020, three years later:

As noted by Daniel Connelly in the comments

IntelliJ now lets people install it through the path specified in the help above (just look for the "Download Now" button on the Git menu).
If you download Git from the website, a version that IntelliJ does not support will be installed.

like image 200
VonC Avatar answered Sep 21 '22 13:09

VonC