5

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.

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

1 Answer 1

9

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.

3
  • 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. Commented Sep 24, 2014 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. Commented Sep 24, 2014 at 18:15
  • This also helps for "Searching for program: no such file or directory, git" problem. Commented Jul 14, 2015 at 12:06

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.