Change Path for OS X

4

4

I am not asking how to change the path for mac OS X terminal windows.

I am having this problem, and I’d like to be able to launch by clicking. It does work if I open it in a terminal window (since the path is set correctly).

I have tried adding a path variable to ~/.MacOSX/environment.plist but to no avail.

How can I change the path for the current user in Mac OS X?

Dan Rosenstark

Posted 2010-01-18T21:15:56.180

Reputation: 5 718

Where is git installed? – Chealion – 2010-01-19T00:39:36.947

Chealion, git is installed in its default location on OSX /usr/local/git/bin – Dan Rosenstark – 2010-01-19T02:27:51.173

Um. Generally /usr/local is for stuff that isn't default. That is you put "local" installations there... A lot of tarbals configure to go there by default but that is not an OS decision. – dmckee --- ex-moderator kitten – 2010-01-19T03:28:38.990

Sorry, I meant that the installer for my Git install (which is the most common one) installed there by default. It's true that my OS had git in another location originally, I think, right? – Dan Rosenstark – 2010-01-19T11:10:21.613

Answers

9

Add a file with your desired path in it (e.g. /opt/local/bin) to the directory /etc/paths.d. This method is how TeXLive does it. You can also add your manpath to /etc/manpaths.d this way.

fideli

Posted 2010-01-18T21:15:56.180

Reputation: 13 618

excellent. I've marked it as "should be on superuser" :)... I'll check it out. +1 for now. – Dan Rosenstark – 2010-01-18T22:37:46.163

1This worked. I ended up using setenv PATH $PATH:/usr/local/git/bin/ in my /etc/launchd.conf. I did reboot, though perhaps it wasn't necessary. Thanks! – Dan Rosenstark – 2010-01-19T12:06:32.000

1Ack! Okay, try this. Add your path to /etc/paths – fideli – 2010-01-19T15:10:15.807

NM. Instead, add a file in /etc/paths.d that has your path in it. – fideli – 2010-01-19T15:12:59.683

I've corrected my answer. – fideli – 2010-01-19T15:20:06.733

Hi Fideli, those paths are not respected by git-cola.... not sure what's up there, but it doesn't read them. The paths in /etc/launchd.conf did better, but destroyed everything in their, um, way. So not sure what to try now. – Dan Rosenstark – 2010-01-20T11:14:28.223

Yikes, man. I just tried it right now with git-cola (even checked through some of the Python code). Not a clue what to do about that. Perhaps try building git-cola from source? There seems to be a script available to set up the OS X dev environment for git-cola. It relies on MacPorts: http://github.com/davvid/git-cola/blob/7458da3455620527b5c2bf9ea27877d02b993dfc/darwin/macports-setup-dev-env.sh . Hopefully someone can give you some better advice for this!

– fideli – 2010-01-21T00:18:09.700