How to change the $PATH in Mac OSX

Posted by Samuel Elgozi on Super User See other posts from Super User or by Samuel Elgozi
Published on 2013-11-13T15:53:21Z Indexed on 2013/11/13 16:00 UTC
Read the original article Hit count: 382

Filed under:
|
|
|

I've installed git via the instaler and not with terminal with commands, and my $PATH changed, the path to the 'local' git was added the the end of the variable, and my $PATH changed to this:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

However, that doesnt help me, because i the path to Xcode's git comes first.

so what I've done is the next, I added this lines to my '.bash_profile':

export PATH="/usr/local/git/bin:$PATH"

and now my path is the next:

/usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

And I wanted to know how to remove the duplication from the end of the Path so I end up with:

/usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Thanks Ahead! And sorry if my english is too bad..

© Super User or respective owner

Related posts about osx

Related posts about bash