将git与emacs一起使用 [英] Using git with emacs

查看:78
本文介绍了将git与emacs一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试配置git.el.当我执行git-status时,我可以看到状态缓冲区已更改,我也可以使用'a'添加文件,但是当我尝试使用c提交文件时编写提交日志并用C-c C-c完成它使我

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

错误和文件未提交.我在OS X上使用emacs23.我添加到.emacs的唯一自定义项是

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")) )

因为emacs找不到git可执行文件.

because emacs failed to find git executable.

推荐答案

在Mac OS X的.emacs中,我有以下代码:

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))

问题似乎是,当您运行terminal.app时,它将使用您的Shell初始化文件来设置所有环境变量,但是当您从Dock启动Emacs时,则不会设置这些变量.

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.顺便说一下-Emacs中还有其他与Git一起使用的软件包-magit,DVC,egg ...您可以在

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

这篇关于将git与emacs一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆