32

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.

Mat
  • 188,820
  • 38
  • 367
  • 383
arjacsoh
  • 8,002
  • 23
  • 99
  • 158

7 Answers7

43

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.

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.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • OK, I have installed Git on a Git directory but I cannot find the executable file to set. What is that? Whatever I have tried has failed promting a window with a message "errors occuring while executing...". – arjacsoh Oct 06 '11 at 08:38
  • 2
    @arjacsoh What is your Os? On Windows, you would have a `/bin/git.exe`, making the `/bin/` the directory to set. – VonC Oct 06 '11 at 08:42
  • Finally, I got it but I downloaded TortoiseGit and I installed this instead. I found the executable file and it works. The file you suggest works rather as well, but I did not try it. I 'll try it on my home PC. Thank you. – arjacsoh Oct 06 '11 at 09:16
  • 1
    @arjacsoh: excellent. On Windows, you usually install msysgit. http://code.google.com/p/msysgit/ – VonC Oct 06 '11 at 09:25
  • 1
    Yeah,https://code.google.com/p/msysgit/ is getting more support so it should be a better choice. – eLRuLL Mar 19 '13 at 22:29
  • An anonymous user [was trying to add](http://stackoverflow.com/review/suggested-edits/8050802) 'Click fix_it. Then update the versionControl executable path. you can test with test options' – VonC May 13 '15 at 12:59
  • For me, pointing to git.exe under `C:\Program Files\Git\mingw64\bin` did the trick. Similar folder structure is present for Portable git version too – rohitmohta Jan 17 '17 at 05:05
  • 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. – Daniel Connelly Jul 28 '20 at 22:59
  • 1
    @DanielConnelly Thank you for this feedback. I have included your comment in the answer for more visibility. – VonC Jul 29 '20 at 07:20
9

GitHub for Windows on Windows 7 currently installs Git in a path similar to this:

C:\Users\{username}\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\bin\git.exe

The guid after PortableGit_ may well be different on your system.

Saugat Bhattarai
  • 1,926
  • 3
  • 21
  • 31
Brian Beckett
  • 4,406
  • 6
  • 27
  • 51
5

On unix systems, you can use the following command to determine where git is installed:

whereis git

If you are using MacOS and did a recent update, it is possible you have to agree to the licence terms again. Try typing 'git' in a terminal, and see if you get the following message:

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

Caroline Even
  • 51
  • 1
  • 3
5

On Window machine install any version of Git. I installed

Git-2.14.1-64-bit.exe

. Got to search program and search for git.exe. The file can be located under

C:\Users\sd\AppData\Local\Programs\Git\bin\git.exe

.

Open Intelli IDEA>Settings>Version Control>Git. On Path To Git executable add the path. Click on Test button. It will show a message as

Git executed successfully

Now click on Apply and Save. This will solve the issue. .

Soumyajit Swain
  • 1,180
  • 16
  • 31
  • This option worked for me. We should not reference the downloaded file. Instead git.exe created after the install should be referenced in intellij. – pyBomb Oct 02 '20 at 19:14
1

git.exe is common for any git based applications like GitHub, Bitbucket etc. Some times it is possible that you have already installed another git based application so git.exe will be present in the bin folder of that application.

For example if you installed bitbucket before github in your PC, you will find git.exe in C:\Users\{username}\AppData\Local\Atlassian\SourceTree\git_local\bin instead of C:\Users\{username}\AppData\Local\GitHub\PortableGit.....\bin.

Revanth Kumar
  • 765
  • 9
  • 17
0

For Linux users, check the value of GIT_HOME in your .env file in the home directory.

  1. Open terminal
  2. Type cd home/<username>/
  3. Open the .env file and check the value of GIT_HOME and select the git path appropriately

PS: If you are not able to find the .env file, click on View on the formatting tool bar, select Show hidden files. You should be able to find the .env file now.

Melebius
  • 4,692
  • 3
  • 32
  • 43
0

Literally, just restarted IntelliJ after it kept showing this "install git" message after I have pressed and installed git, and it disappeared, and git works