Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using git with emacs

I am trying to configure git.el. When i do git-status i can see the status buffer with changed i can also add files using 'a' but when i try to commit a file using c writing the commit log and finishing it with C-c C-c gives me

env: git: No such file or directory

error and file is not committed. I am using emacs 23 on OS X. The only customization i added to my .emacs is

(setq exec-path (append exec-path '("/opt/local/bin")) )

because emacs failed to find git executable.

like image 544
Hamza Yerlikaya Avatar asked May 30 '09 19:05

Hamza Yerlikaya


1 Answers

In my .emacs for Mac OS X i have following code:

(when (equal system-type 'darwin)
  (setenv "PATH" (concat "/opt/local/bin:/usr/local/bin:" (getenv "PATH")))
  (push "/opt/local/bin" exec-path))

It seems, that the problem is, that when you run terminal.app it use your shell initialization file to setup all environment variables, but when you launch Emacs from Dock, then these variables aren't set.

P.S. By the way - there are other packages to work with Git from Emacs - magit, DVC, egg... You can read about them in my article

like image 128
Alex Ott Avatar answered Sep 27 '22 23:09

Alex Ott