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)
    (goto-char (point-max))


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?

  • 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 emacs.stackexchange.com/q/51164/105.
    – Drew
    Nov 25, 2019 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, 2019 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, 2019 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, 2019 at 18:36
  • Thanks for checking. Hopefully someone will have a good answer.
    – Drew
    Nov 25, 2019 at 18:40

1 Answer 1


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.


enter link description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.