1

Possible Duplicate:
How do I set PATH and other environment variables?

I recently installed git 1.7.4.4 via the installer from here http://code.google.com/p/git-osx-installer/ (not via homebrew or stuff...) and found that it added itself to my $PATH.

I wonder, where did it do that? I checked my ~/.bashrc and also /etc/bashrc and /etc/profile, nowhere is a line like PATH=$PATH:/usr/local/git/bin

Out of curiosity, where did the git-installer put the change to the path??

3
  • 1
    Related (with good section on Mac OS X, that already contains both answers from OS).
    – Daniel Beck
    Jun 12, 2011 at 12:41
  • 1
    I don't know about OSX, but on linux, your bash profile generally sources /etc/profile, which then sources /etc/profile.d/*.sh.
    – Cascabel
    Jun 12, 2011 at 15:49
  • IMO this question isn't a duplicate. The OP knows how stuff is usually added to the PATH, but git does it in an unusual way. Jefromi is correct - in the /etc/paths.d directory, there is a file named git containing the path to the git binary.
    – cantera25
    Jun 28, 2015 at 0:11

2 Answers 2

3

Have a look in /etc/paths.d/. If there is a file called git, this is how your $PATH is manipulated.

Since Leopard, there is an alternative method for manipulating the PATH by adding text files to /etc/paths.d/ containing lines that will be appended to the PATH variable. Kind of simple, but it does cause issues if you aren't aware of it.

EDIT: There is also a corresponding /etc/manpaths.d/

1

Perhaps it's located in /etc/paths??

cat /etc/paths