Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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:


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


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

share|improve this question
up vote 2 down vote accepted

The git installer created /etc/paths.d/git. You can remove the path entry by running sudo rm /etc/paths.d/git.

share|improve this answer
I dont want to remove the folder from the hard drive, but only from the pahth variable – Shock E. Nov 14 '13 at 19:00
The files in paths.d are used to configure the path. /etc/paths.d/git just contains one line that adds /usr/local/git/bin to the path. – user495470 Nov 14 '13 at 19:54

You can simply edit the actual .bash_profile file. However, it is hidden, so accessing it can be a bit of a pain. Here are a couple of ways:


With Terminal

If you are comfortable with using Terminal, you can type

nano ~/.bash_profile

And edit the file from there. To save and exit, press Control + X to exit. Then, press 'Y' to save your changes, and simply hit Enter to use that path.

A bit of Terminal, but with an GUI editor

If you would rather use an actual editor, I would suggest using Text Edit so that the file remains a plain .txt, no formatting. To do this, you need to make hidden files visible. (Hidden files are the ones with a . before it)

Unfortunately, the easiest way still involves Terminal. To make files visible or hidden(respectively), type the following

defaults write AppleShowAllFiles YES
defaults write AppleShowAllFiles NO

And then you need to relaunch Finder.

Then you can open the file which is in the main user directory (Yes, that page is outdated, but it does tell you what you need to know).

No Terminal at all

If you want to avoid Terminal all together, you can download apps such as invisibliX to automatically toggle the visibility of hidden files. With that particular app, simply press the magnifying glass to toggle visibility.

Again, I suggest Text Editor for editing the file, which is located in the main user directory (Yes, that page is outdated, but it does tell you what you need to know)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .