On any decent Linux distribution, Git should be installed by default (yeah, looking at you Ubuntu). If that’s not the case, you can just install it from your terminal.
sudo apt install git
sudo pacman -S git
sudo dnf install git
On mac OS
gcc, and any basic developer tool), you must have XCode on your system, so just head to the App Store and install it. . Expect to waste half your afternoon, as it is around 6 GB to download, and then it needs to be installed.
If you won’t use XCode, it’s recommended to just install the XCode Command Line Tools by running:
Alternatively, if you use Homebrew you can install Git by running:
brew install git