Can't Uninstall Git on macOS: Apple Git
This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文
I spent a long time today trying to uninstall git. I thought it was an older version I had installed previously, and even tried disabling SIP to delete it, but it still wouldn't budge. Later, I realized it was the git bundled with macOS.
You can install git through homebrew to override it, but you can't remove it.
bin root# git -v
git version 2.37.1 (Apple Git-137.1)
Apple Git is the Git tool bundled with macOS. It has some minor differences from the standard Git binary. When you run the git command on macOS, the system-provided Apple Git takes precedence.
Because it is provided as part of the operating system, Apple Git is more tightly integrated and works with other macOS tools, such as Xcode. However, the system-provided Git version may not be the latest, so you may need to install a newer version manually.
If you install Git using a package manager such as MacPorts or Homebrew, it will override the system-provided Git. This generally causes no issues, as these tools have been tested and shown to be compatible with macOS.
Last updated 2024-01-14
Comments 0