4

I installed Magit on Windows, but every time I use it, it give me the error:

searching for program: permission denied, git

even though I already installed the git software on windows. (it seems that there is no git available from the cmd). I am using the GUI emacs and not emacs from cygwin.

  • Change your title to something more specific, like "permission denied with Magit on Windows" – Malabarba Sep 24 '14 at 16:19
  • Did you change magit-git-executable? Does it help to set this variable to the absolute path to your Git executable? – lunaryorn Sep 24 '14 at 16:35
  • @lunaryorn No I didn't change that. There is no such variable. – Husain Sep 24 '14 at 18:12
  • @Husain What is your Magit version then? – lunaryorn Sep 24 '14 at 18:15
8

Run: M-x eval-expression (executable-find "git") if it is not found then you need to add git to the exec-path list.

(add-to-list 'exec-path "/path/to/folder/containing/git/executable")

Look at the definition for magit-git-executable and you'll see how, if emacs cannot find git using executable-find, it won't be set correctly.

  • I did so. I got nil. So I added "Eval: (add-to-list 'exec-path "C:/Program Files (x86)/Git/bin/git.exe")" and that didn't help either. – Husain Sep 24 '14 at 18:11
  • 5
    @Husain You need to add the directory containing the Git executable to exec-path, not the Git executable itself. For magit-git-executable, you'd need to use the path to the executable, though. – lunaryorn Sep 24 '14 at 18:15
  • This also helps for "Searching for program: no such file or directory, git" problem. – BartoszKP Jul 14 '15 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.