I have looked at the other posts and have made certain that the path is correct to the executable file, as shown below. I can launch git from from this path outside of Android Studio. The current project is the "sunshine-version 2" from Udacity and it is a version or two old, but this should not affect the VCS from launching. I have read the other posts concerning this issue, but none have resolved this issue.
Also, when Android Studio gradle runs, it will open git in several windows and then close them almost immediately. They pop-up for a second or two, and then close. It's definitely trying to run git, and then default closes?
10 Answers
I just went to the Git path ubication, the only different thing that I did was have stopped at the cmd folder. As you might see in the next screenshot

Subsequently, instead of choosing git-gui.exe option, I select just git.exe option. And it seems to work for me.

2 Comments
The path you configure for git should be C:\Users\Computer\Documents\Development\Git\cmd\git.exe instead. You should use git.exe not git-base.exe.
And add git installed path to environment variables (for windows OS):
This PC -> properties -> Advanced system setting -> advanced Tab -> environment variables -> find path in system variables -> edit -> add the git installed path by ;C:\Users\Computer\Documents\Development\Git\cmd -> ok.
7 Comments
...\Git\cmd\git.exe.C:\Users\Computer\Documents\Development\Git\cmd in your environment variables?I notice a lot of the answers here are correct, depending on given user's circumstances, so I am consolidating and clarifying which is which. Hopefully, someone who comes across this finds it helpful.
When an application with Git integration support requests the location of the executable (or you want to add its location to your PATH environmental variable so that git commands work on the command line without including the full path to the executable), that location depends on a few variables:
- whether you installed Git as an admin (for all Users); and,
- whether you installed the 64-bit / 32-bit version of Git
If git commands work on the command line already
Then it is already properly configured as an environmental variable, and you can simply run:
In terminal/command console:
git --exec-path
In PowerShell:
Get-Command git
Running either of the above should get you the path to your git executable.
If you installed the 64-bit version of Git for all users (or as an administrator)
The path to your git.exe executable should be:
C:\Program Files\Git\cmd\
If you installed the 32-bit version of Git for all users (or as an administrator)
The path to your git.exe executable should be:
C:\Program Files (x86)\Git\cmd\
If you installed the 64-bit OR 32-bit version of Git as a regular user
The path to your git.exe executable should be:
C:\Users\%USERPROFILE%\AppData\Local\Git\cmd\
Note: Replace
%USERPROFILE%with name of the User whose account is the account on which Git is installed or you can simply paste the above into the address bar of a File Explorer window and pressEnterto see if it's a valid location. Alternatively, the below should work as well:%LOCALAPPDATA%\Git\cmd\File Explorer 'understands' that
%LOCATION%variables should be substituted and the value that should replace it. Notice thatgit.exeis intentionally excluded from the location to which we direct File Explorer because including it will effectively tell File Explorer to opengit.exewhich isn't the goal.
If you installed GitHub Desktop, do NOT try to use the included git.exe for third-party application integration!
Important to note that using the git executable that comes packaged with GitHub Desktop is not recommended* to using the embedded git executable that is packaged with GitHub Desktop to integrate other applications. You should install Git for Windows SCM to acquire the appropriate git.exe.
* Good explanation why: GitHub Desktop Official Repository - Issues section
Nativewould be the path specified. It is strange that built-in would give the same error. Can you try Built-in without a path specified? Can you execute this from a command prompt?