reddit / emacs

(doom)Emacs on Windows: Can't find git

Mahdi_Amel · 2022-05-23 21:51
Sadly I've to use it on Windows. I'm getting the following error whenever I'm trying to do (anything?) ​ Error (doom-first-file-hook): Error running hook "global-git-commit-mode" because: (file-missing Searching for program No such file or directory git) Disable showing Disable logging Error (dired-initial-position-hook): Error running hook "doom-first-file-hook-init-on-dired-initial-position-hook-h" because: (doom-hook-error doom-first-file-hook global-git-commit-mode (file-missing Searching for program No such file or directory git)) Disable showing Disable logging I find git regularly in my PATH on Windows, but Emacs still cannot recognize it
dpoggio · 2022-05-23 23:35
I assume you're using something like magit, so git-mode loads automatically. The following lines may be helpful: Set the executable for both Magit and VC `(setq magit-git-executable "C:/Users/user/Documents/git/bin/git.exe")` `(setq vc-git-program "C:/Users/user/Documents/git/bin/git.exe")` Add the git's "bin" folder to the path: `(setenv "PATH" (concat "C:\Users\user\Documents\git\usr\bin;" (getenv "PATH")))` NOTE: You can always see related variables to anything abusing autocompletion, like `C-h v git- TAB` or `C-h v *-git TAB`. Helm even provides `helm-apropos` to narrow your search down on the fly, so you would type like `git exec`, erase, `git prog`, erase, `git path` and peep results for variables. This way, you can spot the maybe's, then use `describe-variable` (`C-h v`) to get the current value and meaning of each.
[deleted] · 2022-05-24 16:56
[deleted]
dpoggio · 2022-05-24 18:41
Anytime