45

I'm using IntelliJ on my MacBook and get this message every time I open the app. I already checked the Preferences > Version Control > Git under "Path to Git executable" and set this path to the path that is shown in my terminal for whereis git. Also, testing the path in the IntelliJ settings returns a "Git version is 2.30.1". What else can I do to fix this problem?

5
  • 1
    Would it be an option for you to use Homebrew git? Could you please install it and change bath to brew Git in IDE settings? There is a chance that you have faced known issue with xcode Git: youtrack.jetbrains.com/issue/IDEA-248193 Commented Sep 23, 2021 at 9:09
  • @RuslanKuleshov Yes I'm using Homebrew git instead of git in IntelliJ at the moment. The path to brew git is in "whereis git" right? If so, the path in the IDE settings is already set to brew git. Commented Sep 23, 2021 at 10:41
  • >The path to brew git is in "whereis git" right? Not necessarily, you may not have changed your PATH variable and it may store your xCode git there. path to homebrew git /usr/local/bin/git Commented Sep 23, 2021 at 11:06
  • @RuslanKuleshov If I set the "Path to Git executable" to /usr/local/bin/git and test it in the settings, it says "Git is not installed No such file" Commented Sep 23, 2021 at 11:11
  • same issue on window, intellij version 2023.2.4 Commented Nov 1, 2023 at 6:44

9 Answers 9

107

In my case the issue was solved by invalidating cache and restarting IDE. Simply go to Files -> Invalidate Caches -> Invalidate and Restart.

Sign up to request clarification or add additional context in comments.

2 Comments

That worked temporarily for me but next time I restarted my computer I got the error again.
You can just restart without invalidating - it will help
25

In my case, the IDE seems only be able to recognize the path of git as /usr/local/bin/git, but git is installed at /usr/bin/git. So I made a softlink between of them.

sudo ln -s /usr/bin/git /usr/local/bin/git 

4 Comments

Oh wow thank you, I think this just solved the problem!
Yes, its working with my Android Studio , in MAC Thanks ...
In my case, I changed the Path to Git executable under Preferences > Version Control > Git to /usr/bin/git and it worked. Thanks for giving me an idea as to what the problem was.
This worked for me (MacOS , IntelliJ). thanks.
9

Open Preferences > Git > version control > git > Path to Git executables : set to

/usr/local/bin/git

or

/usr/bin/git

Comments

5

For people using windows with wsl2, IntelliJ might automatically detect the correct file, but sometimes is not able to access. Restarting wsl and IntelliJ helped for me:

  1. Restart wsl
  • Open cmd as admin
  • run "wsl.exe --shutdown"
  • run "wsl.exe"
  1. Restart intelliJ

1 Comment

Worked for PyCharm on WSL
3

All of the methods above are not working for me.

First of all, I Invalidate Caches -> Invalidate and Restart. Secondly, I have to run the git command manually. Then it seems trigger something internally to find git path, I guess. Afterwards it is working.

Comments

1

Just update/install git with following command:

brew install git

Go to Intellij IDEA (Top left corner) -> Preference -> Version control -> Git -> Enter "/usr/local/bin/git" (generally git is installed in this path to verify it once, you can enter the same in finder) for "Path to git executable"

Boom!! Your Git is back.

Cheers!! :)

1 Comment

This one does work for me.
0

In my case, I fixed this issue by going to Preferences > Build, Execution, Deployment > Build Tools > Gradle and update Gradle JDK from 1.8 to 11

Comments

0

Restarting Pycharm fixed this problem: I did not need to Invalidate Caches or fix the git executable path.

Comments

0

I faced the same issue when switching my terminal profile from "Basic" to "Homebrew," but everything worked fine after reverting back.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.