Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

About 6 months ago I tried installing git and ended up botching the install/configuration. I was then called away to another project and no longer needed to use git. I'm back to the project now, and would like to reinstall git completely from scratch. So I ask:

How do I completely uninstall git from my Ubuntu Desktop 12.04 machine?

When I run which git I get:


Thanks in advance!

share|improve this question

migrated from Sep 25 '13 at 19:13

This question came from our site for professional programmers interested in conceptual questions about software development.

Unless you've really gone out of your way to break things, you can just delete the .git directory in your home directory ( ~/.git ) and your account will go back to everything as default. – Sean McSomething Sep 25 '13 at 16:55
Why do you want to remove git? – Thomas Ward Sep 25 '13 at 19:21
@ThomasW. - why would you want to remove any program from your system? – zharvey Apr 21 '14 at 19:22

Your personal settings for your user related to git are usually stored in ~/.git which is the .git folder in your /home/$USER folder.

Just remove ~/.gitconfig and your settings will return to a pristine, unconfigured state.

if you REALLY want to remove git completely and start over which you don't really need to do ever, do the above statements to remove the .git folder, then do: sudo apt-get purge git; sudo apt-get autoremove; sudo apt-get install git

share|improve this answer
I am not sure why you want him to erase the .git folder. His individual git config --global are also in his /home/user/.gitconfig file. – haziz Dec 17 '13 at 0:19
@haziz thanks, updated. – Thomas Ward Dec 17 '13 at 0:38

you can use this command:

sudo apt-get remove git
share|improve this answer
As already answered. – A.B. Sep 18 '15 at 14:04
@A.B. Not really – Pilot6 Sep 18 '15 at 14:05

Reinstalling git with

sudo apt-get install git

will usually fix most installation issues.

share|improve this answer

Your Answer


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.