Windows 7. Emacs 24.3.1. Git 1.8.1.msysgit.1. I have the following in my equivalent .emacs file:
(if (equal system-type \'windows-nt)
(progn (setq explicit-s
I know this is an older question, but I found it while I was searching for help on the same issue, so here's the solution I use for my particular use case, in case it helps someone in the future.
I sync up my .emacs.d
between all computers I use emacs on, which includes both Linux & Windows machines. I inserted this into my init.el
file to automatically deal with this issue appropriately in a Windows environment:
;; Set Windows-specific preferences if running in a Windows environment.
(defun udf-windows-setup () (interactive)
;; The variable `git-shell-path' contains the path to the `Git\bin'
;; file on my system. I install this in
;; `%USERPROFILE%\LocalAppInfo\apps\Git\bin'.
(setq git-shell-path
(concat (getenv "USERPROFILE") "\\LocalAppInfo\\apps\\Git\\bin"))
(setq git-shell-executable
(concat git-shell-path "\\bash.exe"))
(add-to-list 'exec-path git-shell-path)
(setenv "PATH"
(concat git-shell-path ";"
(getenv "PATH")))
(message "Windows preferences set."))
(if (eq system-type 'windows-nt)
(udf-windows-setup))
Please note that the variable git-shell-path
will need to be defined based on where you have git
installed on your system. I install it in %USERPROFILE%\LocalAppInfo\apps\Git
on the one Windows machine where I use it.