‘Restoring’ Git after Upgrade to OSX Lion
I was surprised to find out my ‘git’ command didn’t work after upgrading to Lion.
It is still there (verify by checking for this directory: /usr/local/git/bin), just needs to be mapped.
I was able to find out that the git installer uses paths.d to add it to the path.
I went to /etc/paths.d and did ls – but there was not git file.
open Terminal
cd /etc/paths/d
sudo vi git
enter /usr/local/git/bin at the top of the file (if new to vim, hit ‘I’ to enter ‘insert mode’)
hit escape – type :wq to save and quit
open new terminal – run ‘which git’
Should work now
Thanks for this! not familiar with path.d, is it a directory of path environment variables?
Also, you had a typo:
cd /etc/paths/d
should be
cd /etc/paths.d
Thanks very much!
Ah, thanks, I will update to reflect that!
And yes, those are basically path environment variables from what I understand
Great tip, Steve, very useful. Thanks a bunch!