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

GithubAndroid Studio

Github Problem Overview


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 ...?

Github Solutions


Solution 1 - Github

I've solved the problem , and I will explain how :

  1. Download Github For Windows client and install it.
  2. After The client successfully installed , connect it with your github account.It should be easy , just follow the wizard.
  3. Then you should add git.exe location to your "Path Variable". The location you should add will probably be something like : C:\Users\Your_Username\AppData\Local\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\bin

Alternatively , if you don't want to add to environment variables. You can open the android studio and go to : Settings -> Version Control -> Git In text box next to "Path to Git Executable" you will see "git.exe" , just give it a full path like so : C:\Users\Your_Username\AppData\Local\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\bin\git.exe

EDIT : For latest Github for windows versions some can find the git.exe under "...\cmd\git.exe" rather than "...\bin\git.exe".

Solution 2 - Github

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

Solution 3 - Github

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

Solution 4 - Github

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

Solution 5 - Github

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

Solution 6 - Github

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

  1. Apply and Ok

  2. Try to clone from Check out project from Version Control

  3. Done

enter image description here

Solution 7 - Github

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

Solution 8 - Github

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.

Solution 9 - Github

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIveliusView Question on Stackoverflow
Solution 1 - GithubIveliusView Answer on Stackoverflow
Solution 2 - GithubDakatineView Answer on Stackoverflow
Solution 3 - GithubGvthaView Answer on Stackoverflow
Solution 4 - GithubJeevan TimsinaView Answer on Stackoverflow
Solution 5 - GithubMuhamed Riyas MView Answer on Stackoverflow
Solution 6 - GithubKetan RamaniView Answer on Stackoverflow
Solution 7 - GithubJudy YuView Answer on Stackoverflow
Solution 8 - GithubNaishil PatelView Answer on Stackoverflow
Solution 9 - GithubJeff PadgettView Answer on Stackoverflow