49

I downloaded Github for windows and installed it on my computer, which runs windows 7. I tried to open a project with Android Studio but it says "Can't start Git: git.exe" and "IDE error".

When I click "Fix it" it shows:

"Cannot run program "git.exe": CreateProcess error=2, The system cannot find the file specified".

So I googled and I tried to find git.exe file in my Github folder. In my Github folder there is two folders: one is a project shared by my friend and the other one is "Git1". In Git1 foler, there are only two files: ".gitattributes" and ".gitignore" I can't find "git.exe" file even with the search bar of windows.

How can I fix this error?

Kjartan
  • 17,127
  • 14
  • 67
  • 84
tesio
  • 391
  • 1
  • 3
  • 10

9 Answers9

116

The git.exe from Github for windows is located in a path like C:\Users\<username>\AppData\Local\GitHub\PortableGit_<numbersandletters>\bin\git.exe1 You have to replace <username> and <numbersandletters> to the actual situation on your system.

In Android Studio you can specify the path to the Git executable at File->Settings...->Version Control->Git->Path to Git executable. Here you have to include the actual executable name. As an example, in my case the actual path is: C:\Users\dennis\AppData\Local\GitHub\PortableGit_69703d1db91577f4c666e767a6ca5ec50a48d243\bin\git.exe

Edit: Last git update has put the git.exe file in cmd\ folder instead of bin\ . so now the actual path will be as suggested in the comment below by al3xAndr3w.

C:\Users\<username>\AppData\Local\GitHub\PortableGit_<numbersandletters>\cmd\git.exe
Community
  • 1
  • 1
Dennis van der Schagt
  • 2,315
  • 2
  • 28
  • 31
  • 11
    last windows git update moved the exe to the cmd folder instead of the bin, so you can use that for IDEs such as webstorm and other.. BUT!: if you want to have git and ssh and ls and other linux commands in win powershell or cmd add to the windows PATH folder ..../PortableGit..4kj3h43k4..../mingw32/bin/ – drew7721 Dec 03 '15 at 07:45
  • 1
    @al3xAndr3w Nice find! Feel free to create your own answer for this as it contains some new elements and I've gotten far more points with this post than my simple answer deserves. If you don't I will probably edit this information into this answer for better visibility in a few days. – Dennis van der Schagt Dec 03 '15 at 22:26
  • 2
    For `Git for Windows` users (not `GitHub for Windows`) git.exe path is probably already in `PATH` variable and you can find the path by `where git.exe` on git-cmd which is by default "C:\Program Files\Git\cmd\git.exe" – Beytan Kurt Mar 11 '16 at 15:55
  • 1
    Gone. no more git.exe at that location – Menachem Hornbacher Aug 28 '16 at 18:18
20

run github that you downloaded, click tools and options symbol(top right), click about github for windows and then open the debug log. under DIAGNOSTICS look for Git Executable Exists:

user4320164
  • 201
  • 2
  • 2
  • 1
    And if it doesn't exist? – portfoliobuilder May 30 '15 at 20:51
  • If you don't see it, do a crtl + f (search on the .txt file) for the key words, "4|StartupLogging| Git Executable Exists:" and the path following that text should show it. Otherwise, I'd suggest upgrading to the latest github client. – rj2700 Oct 25 '15 at 21:00
16

I found git here

C:\Users\<User>\AppData\Local\GitHubDesktop\app-0.5.8\resources\app\git\cmd\git.exe

You have to write file name (git.exe) in the end of path otherwise it will give an error=5enter image description here


Or you can check here also.

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

enter image description here

Amit Singh
  • 431
  • 4
  • 6
11

The last update for "windows git" did move the git.exe file from the /bin folder to the /cmd folder. So, to use git with IDEs such as webStorm or Android Studio you can use the path :

C:\Users\<user>\AppData\Local\GitHub\PortableGit_<..numbers..>\cmd\git.exe

But if you want to have linux-like commands such as git, ssh, ls, cp under windows powerShell or cmd add to your windows PATH variables :

C:\Users\<user>\AppData\Local\GitHub\PortableGit_<...numbers...>\usr\bin

change <user> and <...numbers...> to your values and reboot!

Also, you will have to update this everytime git updates since it might change the portable folder name. If folder structure changes I will update this post.

Thx @dennisschagt for the comment above! ;)

Mr Lister
  • 42,557
  • 14
  • 95
  • 136
drew7721
  • 1,503
  • 16
  • 19
9

I faced the same issue and was not able to find it out where git.exe is located. After spending so much time I fount that in my windows 8, it is located at

C:\Program Files (x86)\Git\bin

And for command line :

C:\Program Files (x86)\Git\cmd

Hope this helps someone facing the same issue.

Smeet
  • 3,558
  • 1
  • 28
  • 42
4

As of version 2.10.1, here is the path -

C:\Users\usersam\AppData\Local\Programs\Git\cmd\git.exe

Sampath Pasupunuri
  • 568
  • 1
  • 9
  • 24
4

1) Install Git for Windows from here: http://git-scm.com/download/win

2) Note: During installation, Make sure "Use Git and optional Unix tools from the windows command prompt" is selected enter image description here

3) restart the Android Studio and try again

4) Go to File-> New -> Project from version control -> Git

Revan siddappa
  • 618
  • 7
  • 15
3

I found my git.exe here

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

while installing git, it asks for the location. copy it and use it.

Prabs
  • 4,376
  • 6
  • 34
  • 55
2

The path for the latest version of Git is changed, In my laptop, I found it in

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

This resolved my issue of path. Hope that helps to someone :)

Anum Sheraz
  • 1,400
  • 17
  • 37