1

Start Emacs from gitbash (MINGW64)

Snippet below is loaded automatically:

; add el-get to the load path, and install it if it doesn't exist
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
    (goto-char (point-max))
    (eval-print-last-sexp)))

Error:

Warning (initialization): An error occurred while loading 'c:/Users/user/.emacs':
error: Unable to find 'git'

To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the '--debug-init' option to view a complete error backtrace.

; add el-get to the load path, and install it if it doesn't exist (add-to-list 'load-path "~/.emacs.d/el-get/el-get") (unless (require 'el-get nil 'noerror) (with-current-buffer (url-retrieve-synchronously "https://raw.github.com/dimitri/el-get/master/el-get-install.el") (goto-char (point-max)) (eval-print-last-sexp)))

Environments and settings:

  • Windows 10
  • Git installed (git version 2.14.1.windows.1)
  • Git installation path(C:\Program Files\Git\cmb) is added to Environment path variable.
  • HOMEPATH: c:/Users/user
  • emacs version: GNU Emacs 26.1 (build 1, x86 64-w64-mingw32) of 2018-05-30

git can not be found even though it's installed. How can I configure Git set-up properly?

Drew
  • 75,699
  • 9
  • 109
  • 225
YiC
  • 105
  • 1
  • 8
  • Just to be sure: Are you sure that your `PATH` env var points to the git executable? (I know you said it does.) If not, then this question sounds like a duplicate of https://emacs.stackexchange.com/q/51164/105. – Drew Nov 25 '19 at 17:49
  • yes - "C:\Program Files\Git\cmd\" is added to `PATH` env var. Under the cmd folder, there are application files: git; git-gui; gitk. Thank you Drew for looking at my question! – YiC Nov 25 '19 at 18:19
  • at the same time found on github that this `(setq exec-path (cons "/usr/local/git/bin/" exec-path))` may help Emacs to locate the executable. I will try to see if it fixes the issue. – YiC Nov 25 '19 at 18:23
  • added both `(setq exec-path (cons "C:/Program Files/Git/cmd/" exec-path))` and `(setq exec-path (cons "C:/Program Files/Git/bin/" exec-path))` to my ~/.emacs file but it does not help. – YiC Nov 25 '19 at 18:36
  • Thanks for checking. Hopefully someone will have a good answer. – Drew Nov 25 '19 at 18:40
  • The snippet seems to be duplicated after the error in you post, or do I miss something? – JeanPierre Nov 25 '19 at 20:13

1 Answers1

2

fixed by also adding the (setq exec-path (cons "C:/Program Files/Git/bin/" exec-path)) to another file (el-get-settings) where the snippet is actually in.

Cloning into 'el-get'...
POST git-upload-pack (837 bytes)

Congrats, el-get is installed and ready to serve!nil

Thanks to these two posts - very helpful.

https://github.com/dimitri/el-get/issues/220

enter link description here

YiC
  • 105
  • 1
  • 8