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!


5 Answers 5


you can use this command:

sudo apt-get remove git

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


Reinstalling git with

sudo apt-get install git

will usually fix most installation issues.


I faced the similar issue when another git client was installed on my ubuntu 18.04 LTS without my with a different path :

PATH=/home/pradan/ti-processor-sdk-linux-am57xx-evm- variables...:/snap/bin

To remove it, the PATH VARIABLE needs to be changed. Changing the path can be seen in this question How can I edit the $PATH on linux?

Then, the git files in the same directory can be deleted.


To remove just git package itself from Ubuntu execute on terminal: sudo apt-get remove git Uninstall git and it's dependent packages sudo apt-get remove --auto-remove git

from here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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