How to Remove Git from Your System (Windows, macOS, Linux)

There may come a time when you need to uninstall Git—whether you’re troubleshooting, switching versions, or simply no longer need it. In this guide, we’ll walk through how to remove Git completely from Windows, macOS, and Linux systems.


✅ On Windows

🔹 Uninstall via Control Panel

  1. Go to Control Panel > Programs > Programs and Features
  2. Find Git in the list
  3. Right-click and choose Uninstall

🔹 Optional: Remove Remaining Git Files

After uninstalling, you may still have leftover configuration files:

  • Delete .gitconfig from your user directory:
    C:\Users\YourName\.gitconfig
  • Delete the Git folder from: C:\Program Files\Git\

✅ On macOS

🔹 If Installed via Homebrew

brew uninstall git

🔹 If Installed Manually

If you installed Git from source or a package:

  1. Remove the binary:
sudo rm -rf /usr/local/git
  1. Remove any symbolic links:
sudo rm /usr/local/bin/git
  1. Optionally remove your Git config:
rm ~/.gitconfig

✅ On Ubuntu/Linux

🔹 Remove Git via APT (Debian/Ubuntu)

sudo apt remove git

To remove additional configuration files:

sudo apt purge git

And clean up:

sudo apt autoremove

🔹 Remove Git Installed from Source

If you built Git manually and installed it under /usr/local, remove it with:

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

You can confirm Git is removed with:

git --version

You should see a message like git: command not found.


🔁 Optional: Remove Git Config Files

Regardless of the OS, Git may leave behind global config files:

rm ~/.gitconfig
rm -rf ~/.git/

These are safe to delete if you are removing Git completely.


🧠 Summary

OSUninstall Command / Method
WindowsControl Panel → Programs → Uninstall Git
macOSbrew uninstall git or manual removal
Ubuntusudo apt remove git / sudo apt purge git
Sourcerm -rf Git directories from /usr/local

🚀 Final Thoughts

Removing Git is simple, but be sure to clean up any lingering configuration files if you’re troubleshooting. If you’re reinstalling Git, make sure to download it from a trusted source or use your system’s official package manager.

Sharing Is Caring:

Leave a Comment