I'm using Emacs 24 on OS X 10.6.8. Doing magit-status
says
Searching for program: no such file or directory, git
However, the Emacs shell is able to find git
, so this does not seem to be a $PATH
issue. What else could it be?
To see if Git is installed on your system, open your terminal and type git --version . If your terminal returns a Git version as an output, that confirms you have Git installed on your system.
Download and Install Git making sure Use Git from the Windows Command Prompt is selected when prompted. At the end, reopen the Command Prompt. The git command should now be recognized as expected. In some cases, a computer restart may be needed.
Checking for Git Once you've opened your terminal application, type git version . The output will either tell you which version of Git is installed, or it will alert you that git is an unknown command.
Installing Git on Windows. Go to Git's download page and click “Windows”. An .exe file should be downloaded to your “Downloads” folder. Open the downloaded Git .exe file.
Try checking the value of exec-path
variable. This controls the directories which are looked by Emacs for external executables (including git).
This is a customizable variable, and you can add the path to git
to the list of existing directories.
I have the elisp snippet in my .emacs.d/init.el
file for my Emacs install under OSX, which sets both the PATH
and exec-path
correctly.
;;; Set localized PATH for OS X
(defun my-add-path (path-element)
"Add the specified PATH-ELEMENT to the Emacs PATH."
(interactive "DEnter directory to be added to path: ")
(if (file-directory-p path-element)
(progn
(setenv "PATH" (concat (expand-file-name path-element) path-separator (getenv "PATH")))
(add-to-list 'exec-path (expand-file-name path-element)))))
(if (fboundp 'my-add-path)
(let ((my-paths (list "/opt/local/bin" "/usr/local/bin" "/usr/local/git/bin")))
(dolist (path-to-add my-paths (getenv "PATH"))
(my-add-path path-to-add))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With