Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Git Integration - git --version empty output

I am currently trying to use the Git integration for IntelliJ 2016.2, but whenever I point it to the executable I get the following issue:

Git Version output problem

This doesn't technically prevent the integration from working but it does cause issues updating the index etc.

I'm running Windows 7, with a completely fresh install, but I had the same issue on the previous PC (these are work machines with various irritating levels of security) but I have colleagues with the same kit that have no such issues.

EDIT

I should have mentioned that it works fine on the command line:

Git Command Line Output

I'm sure I've read something about a change in the way this works internally that means when it's called by an outside executable the output gets screwed up, but I can't find the reference again.

like image 838
rbrtl Avatar asked Aug 10 '16 07:08

rbrtl


People also ask

Can not run Git in IntelliJ?

go to the terminal and type git --exec-path to get your git path. then go to IntelliJ and configure it, Click browse and select your git path. select git and hit test.

How do I get latest Git code from IntelliJ?

From the main menu, choose VCS | Update Project or press Ctrl+T . The Update Project dialog opens. Select the update type (this strategy will be applied to all roots that are under Git version control): Merge the incoming changes into the current branch: select this option to perform merge during the update.

How do I get Git options in IntelliJ?

One way to open the Git tool window is to hover over the quick access button in the bottom left of the IntelliJ IDEA window, and select Git. This will open the Git Log tool window. Alternatively, you can use ⌘9 (macOS), or Alt+9 (Windows/Linux), to open the Git Log tool window.


3 Answers

Make sure you set the right path to Git executable: IntelliJ > Settings > Version Control > Git should be C:/.../Git/bin/git.exe

Do not set git-bash.exe or git-cmd.exe

like image 132
user8208587 Avatar answered Nov 01 '22 20:11

user8208587


Happened to me the exact same thing.

git is working from the command line but the path:

C:\Program Files\Git\bin\git.exe

and the path (as the say here):

C:\Program Files\Git\cmd\git.exe

(which is the path I got when I did where git.exe in cmd)

didn't work.

So I went to git-bash and did where git.exe, and I got a different path, which is working.

enter image description here

Hope it helps

like image 35
nogmos Avatar answered Nov 01 '22 21:11

nogmos


first get your git.exe path by using command. type this in cmd terminal

git --info-path

then find location your_directory\Git\bin\git.exe mine was C:\Users\saigopi\AppData\Local\Programs\Git\bin

add this path in android studio

File->Settings-> Version Control -> Git

add your path at Path to Git Executable and test it

like image 2
saigopi.me Avatar answered Nov 01 '22 22:11

saigopi.me