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
- Go to Control Panel > Programs > Programs and Features
- Find Git in the list
- 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:
- Remove the binary:
sudo rm -rf /usr/local/git
- Remove any symbolic links:
sudo rm /usr/local/bin/git
- 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
OS | Uninstall Command / Method |
---|---|
Windows | Control Panel → Programs → Uninstall Git |
macOS | brew uninstall git or manual removal |
Ubuntu | sudo apt remove git / sudo apt purge git |
Source | rm -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.