1

Magit doesn't recognize my git repos. I think it can't find my git. When i type

M-x magit-version

i get

Magit 20170322.1550, Git (unknown), Emacs 25.1.1, darwin

I am using mac osx. my git is here:

$ which git
/usr/local/bin/git

$ git --version
git version 2.7.1

And i can use git commands normally outside of magit. Does anyone know I can get magit to find my git? Adding the path to .bash_profile does not help.

user6794223
  • 192
  • 9

2 Answers2

2

The variable magit-git-executable tells magit which command to run. If you set this to /usr/local/bin/git it should work.

Alternatively you could add /usr/local/bin to exec-path and not touch magit-git-executable.

Randy Morris
  • 39,631
  • 8
  • 69
  • 76
  • 1
    how/where do i set `magit-git-executable` ? – user6794223 Mar 23 '17 at 18:35
  • 1
    You can use the customize interface or you can set it yourself in your `~/.emacs.d/init.el` or `~/.emacs` file. To use the customize interface run `M-x customize-variable` followed by `magit-git-executable` when prompted for a variable name. – Randy Morris Mar 23 '17 at 18:38
  • putting it in `.emacs.d/init.el` worked. But I ran into more problems. https://github.com/purcell/exec-path-from-shell solved everything – user6794223 Mar 24 '17 at 16:02
1

In order to solve this problem I had to install: github.com/purcell/exec-path-from-shell

magit began working for me after this.

user6794223
  • 192
  • 9