Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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..

share|improve this question
add comment

2 Answers

up vote 1 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 –  Samuel Elgozi 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. –  Lauri Ranta Nov 14 '13 at 19:54
add comment

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:

NOTE: FOR ALL METHODS, SAVE THE FILE AS A PLAIN TXT!

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 com.apple.Finder AppleShowAllFiles YES
or
defaults write com.apple.Finder 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.