How to set "git" to PATH for PhoneGap build in WIndows 8

14,558

Solution 1

You have to add the location of git's bin to your PATH. On Windows, open up Start, search for "Environment Variables", click "Edit environment variables for your account", go to PATH, and append ;C:\Program Files (x86)\Git\bin to the end of the PATH variable. You need the leading ; to separate the various paths you have there. After this you may need to log off and log on again for the changes to take affect.

Solution 2

Get git from here: http://msysgit.github.com/

Note: You must have msysgit installed on your machine. Also, the path to my git install is

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

yours might be different. Please check were yours is before continuing.

  • Right-Click on My Computer
  • Click Advanced System Settings link from the left side column
  • Click Environment Variables in the bottom of the window
  • Then under System Variables look for the path variable and click edit
  • Add the pwd to git's bin and cmd at the end of the string like this:

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

Source: http://blog.countableset.ch/2012/06/07/adding-git-to-windows-7-path/

Share:
14,558
Bacon2305
Author by

Bacon2305

I am a full-time student and created this account to learn as much as possible about topics covered in my coursework.

Updated on June 05, 2022

Comments

  • Bacon2305
    Bacon2305 almost 2 years

    I am trying to add a plugin to my PhoneGap application using this command:

    phonegap local plugin add https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin.git
    

    and received this error:

    Error: "git" command line tool is not installed: make sure it is accessible on your PATH.
    

    so I downloaded this:

    C:\Program Files (x86)\Git
    

    but now I am having trouble setting it to PATH! My Environment Variables and PATH are set as:

    ANDROID_HOME: C:\Android Development\adt-bundle-windows-x86_64-20130729\sdk
    ANT_HOME: C:\Program Files\ANT\apache-ant-1.9.3 
    JAVA_HOME: C:\Program Files\Java\jdk1.7.0_51;
    PATH: %JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools
    

    Can someone please help me set git to PATH so I can correctly install this plugin?

  • MBillau
    MBillau about 10 years
    I guess this assumes that you have installed the git client already. I don't remember if mysgit needs to be installed or if you can just run it from the download location.
  • Bacon2305
    Bacon2305 about 10 years
    I went ahead and installed it, can I install the plugin for the PhoneGap app there?
  • Bacon2305
    Bacon2305 about 10 years
    @MBillau- Thank you! I added this to the PATH and restarted, it worked perfectly.
  • Bacon2305
    Bacon2305 about 10 years
    @MBillau- I'm getting new build errors now. Tried to remove the above, restart, and still getting errors about JAVA_HOME not being set correctly. Which it is. Could this be due to the git files install in the app and not having the git added to the PATH any longer?
  • MBillau
    MBillau about 10 years
    It looks the same as my path...I do have the %JAVA_HOME% and %JAVA_HOME%\bin` though, not sure if that matters. You might need to add the paths to the System Environment Variables but I don't think so. You can type echo %PATH% in a cmd prompt or echo $PATH in a msysgit cmd prompt. In both cases you should see paths to git/bin, java jdk/bin, ant/bin, android/tools, android/platform-tools, and maybe more for other platforms and tools (npm and node come to mind, any other platform's SDKs.) When you run phonegap/cordova commands, you can add -d to get more output.