Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Getting Started With Git Working With Git Repositories

3,244 Points

What are the steps to uninstall GIT on Mac ?

I am unable to run the version of GIT I installed and I need to uninstall it. Can someone provide the steps please ?

6 Answers

That looks good to me. Good luck!


If you are comfortable using the command line, you should be able to uninstall git. This Stack Overflow thread may be able to help. Just don't copy and paste, because depending on how you installed git, it could be at a number of locations. Running which git should return where it is installed. Mine exists at /usr/local/bin/git.

If you do not have sufficient privilege to execute these commands, you may need to execute them using sudo. Take care when using sudo, and double check everything before executing.

$ which git

$ sudo rm -rf /absolute/path/to/git

Hope this helps

Edit: Add note about sudo

This answer is much less confusing, so I've deleted my comment :)

3,244 Points

Thanks Rand, I also found both of those links and tried them Error: permission denied.

which git Mine lives /usr/local/Git/bin/git

Can you be more specific. Which directory should I be in when I type those commands ?

which git returns an absolute path, so your current working directory should not matter. Its great that you were able to locate your installation of git, but now it seems that you are having permission issues. All you need to do is run the same commands that you tried, only this time with sudo in front of it. It should prompt you for a password, and proceed if entered successfully.

Just a word of caution, using sudo is powerful thing –it is essentially saying "I know what I am doing, computer, so do exactly what I say". Its important to be careful, so make sure your double check everything before executing.

The command you are looking for, then would be similar to this (with the proper path to your git installation):

$ sudo rm -rf /path/to/git
3,244 Points

I understand. I have used sudo. I am still rusty with UNIX

on my computer returns which GIT Returns /usr/local/git/bin/git

Is this the proper path for the command ?

sudo rm -rf /usr/local/git/bin/git

Just checking before I try this again.

Sorry about the late reply. I was trying to get MAMP installed. I had it installed manually but needed to install the MAMP with the GUI to continue with the Wordpress Track.

I really appreciate your help.

3,244 Points

I took a breath and tried it. got a 'warning' so I did not type in my password. Can you decipher the error ? Thanks

$ sudo rm -rf /usr/local/git/bin/git dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid Password:

OHHH I wanted to close terminal and had to type password to logout. So it executed the command. I did a check. $ which git $ which git Looks like there isn't a git.... it just rolls back around.

If you can decipher that warning it would be nice.

I may need you because i have to reinstall in the very near future. thanks again.

Glad you got it working. I am not too sure what the warning is about, but found a [thread on stack overflow] that might be of help if the warning persists. Good luck in your endeavors!

3,244 Points

I have GIT INSTALLED :) Thanks