[github] Android Studio Checkout Github Error "CreateProcess=2" (Windows)

Today I've tried to checkout my Github project using brand new Android Studio and ended up with this nasty error :

enter image description here

Why things just never work out of the box ...?

This question is related to github android-studio

The answer is


If you have downloaded Github Desktop Client 1.0.9 then the path for git.exe will be

C:\Users\Username\AppData\Local\GitHubDesktop\app-1.0.9\resources\app\git\cmd\git.exe


Steps:

1) Download git for windows https://git-scm.com/downloads

2) Install downloaded git with default setup

3) From Android Studio close if any project is open then Click on Configure -> Settings -> Version Control -> Git

4) Change Path to Git executable : git.exe to C:\Program Files\Git\cmd\git.exe

5) Apply and Ok

6) Try to clone from Check out project from Version Control

7) Done

enter image description here


I am using Windows 10 OS and GitHub Desktop version 1.0.9.

For the new Github For Windows, git.exe is present in the below location.

%LOCALAPPDATA%\GitHubDesktop\app-[gitdesktop-version]\resources\app\git\cmd\git.exe

Example:

%LOCALAPPDATA%\GitHubDesktop\app-1.0.9\resources\app\git\cmd

I faced same issue in android studio 3.2.1, solved the issue by setting git path in System Environment variable

C:\Program Files\Git\bin\,C:\Program Files\Git\bin\

And I imported the project once again and solved the issue!!!

Note : Check your android studio git settings has properly set the correct path to git.exe

enter image description here


I encountered a similar error with RubyMine 2016.3 recently, wherein any attempts at checkout or export to Github were met with "Cannot run program 'C:\Program Files (x86)\Git\cmd\git.exe': CreateProcess error=2, The system cannot find the file specified"

As an alternative solution for this problem, other than editing the Path system variable, you can try searching through the program files of Android Studio for a git.xml file and editing the myPathToGit option to match the actual location of git.exe on your computer. This is how I fixed this similar issue in RubyMine.

Posting this solution here for the sake of posterity.


I had this issue on Mac. I simply quit Android Studio and restarted it, and for some reason had no further issues.


I found what I think is a faster solution. Install Git for Windows from here: http://git-scm.com/download/win

That automatically adds its path to the system variable during installation if you tell the installer to do so (it asks for that). So you don't have to edit anything manually.

Just close and restart Android Studio if it's open and you're ready to go.

wizard sample


for Android Studio 3.0.1, you can config GitHub path for following path:

  1. File > Setting > Version Control
  2. List item
  3. Click "+" on the top-right conor to open "Add VCS Directory Mapping"
  4. Click "Configure VCS" to open "Version Control Configurations"
  5. Click "Git" then you'll see Path to Git executable]
  6. Input : C:\Users[you user name]\AppData\Local\GitHub\PortableGit_d7effa1a4a322478cd29c826b52a0c118ad3db11\cmd\git.exe
  7. Test it

enter image description here