Dom
Dom

Reputation: 3126

Problems with setting git on Sublime Text 2 "Executable '['git']' was not found in PATH."

I am a new Sublime Text 2 user and I already think it's brilliant.

Although I have some problems getting Git up and running.

I've installed the Git, but keep on getting the following window message.

error message

How can I resolve this problem?

Upvotes: 1

Views: 8545

Answers (3)

Hiago Silvério
Hiago Silvério

Reputation: 26

Not less important, you can try by environment variables in Windows, follow these instructions:

  • Get the folder path of the git.exe
    64bits: C:\Program Files\Git\bin
    32bits: C:\Program Files (x86)\Git\bin
  • Go to the control painel.
  • Double click on system.
  • Click on enviroment variables button.
  • Will appear the variable enviroment window with 2 sections, variables for the xx user and down there system variables
  • Select the variable Path in system variables and click in edit button.
  • You will see a lot of paths with a semicolon after each path in variable value
    C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem;C:\Program Files\Microsoft\Web Platform Installer;
  • What you must to do is insert the github's folder path after the last semicolon or being the first path, resulting in something like this: C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\Git\bin or this: C:\Program Files\Git\bin;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem;C:\Program Files\Microsoft\Web Platform Installer
  • Click on OK button and close the enviroment variables window and the property system window.
  • After you did that if the path is correct, restart the Sublime Text and test the git extension in Sublime Text, always that you modify the path variable is necessary to restart the Sublime Text to load the new data.
  • The default path folders are for 64bits (C:\Program Files\Git\bin) and 32bits (C:\Program Files (x86)\Git\bin)
  • This was tested in Windows 8 64bits in Sublime Text 3

Upvotes: 0

Ɛɔıs3
Ɛɔıs3

Reputation: 7853

According to this page, you have to open Preferences > Package Settings > SublimeGit > Settings - User, and write it (assuming you have the same path to git.exe, else change it). The code below works only for git 32 Bits version :

{
  "git_executables": {
    "git": ["C:/Program Files (x86)/Git/bin/git.exe"]
  }
}

Tested at the moment and functional!


EDIT (Added code for 64 Bits systems)

As I needed to update git, it moved to 64-bit version. If you are also in this case, enter this :

{
  "git_executables": {
    "git": ["C:/Program Files/Git/bin/git.exe"]
  }
}

Upvotes: 1

longhua
longhua

Reputation: 4242

First of all, please make sure you have already installed Git. If so, you can add it to system's Path or change git_command in Git.sublime-settings. Please check this plugin's document for details: the Settings part.

This plugin has a few settings. If you create a file called Git.sublime-settings in your User package you can override them. Feel free to copy the Git.sublime-settings file from the Git package directory to your User package if you don't want to mess with getting the initial JSON syntax right.

git_command: a path to your git binary if it's not in the $PATH available to Python (you'll get an error message if you need to set this)

(format for windows: "git_command": "c:/users/myuserdir/dev/git/bin/git.exe". If you have spaces in your git binary's path, you may need to use the old tilda-escaped version, like: "C:/Progra~2/Git/bin/git.exe".)

Upvotes: 3

Related Questions