I go to https://git-scm.com/downloads to find instructions for installing Git on MacOS. That page directs me to first install Homebrew.
I go to https://brew.sh/ and paste this in my terminal as per the instructions
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
That install script ends in the error message
You must install Git before installing Homebrew. See:
https://docs.brew.sh/Installation
So I go to https://docs.brew.sh/Installation to find out more.
There is nothing on there about how to install Git before homebrew.
Catch22 much?
I see that there is some guy named timcharper who made a binary of Git for use with MacOS. Seems like a big workaround to rely on a private persons binary (also, that's an old version of Git) to break this catch22 issue.
What is the recommended solution here? Seems like I'm stuck in an infinite loop =) Is this a new problem with Ventura?
--------------------------- UPDATE ---------------
Managed to remove the xcode-select version I hade (which apparently lacked git) and reinstalled it. Now I have a fully functional git in my terminal. I have pulled several repo:s.
However, the brew installer is still not happy with my git version and denies install.
mattiaswelander@a ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R mattiaswelander:admin /usr/local/Homebrew
Unexpected Git version: ''!
You must install Git before installing Homebrew. See:
https://docs.brew.sh/Installation
mattiaswelander@a ~ % git --version
git version 2.39.2 (Apple Git-143)
--------------- Another update ----------------
So I finally gave in to that binary from sourceforge, even though Apple has a clear warning sign that this binary has not been scanned for malicious code, you open it at your own peril.
but even after doing so, the error in the brew install script remains the same, it is unhappy with my git version.
as is obvious from below, terminal now runs my recently downloaded, much older version of git as suggested at https://git-scm.com/downloads
mattiaswelander@a ~ % git --version
git version 2.39.2 (Apple Git-143)
mattiaswelander@a ~ % git --version
git version 2.15.0
The error process seems to move a little further this time, but in the end it all collapses at the same error - the git version:
Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /usr/sbin/chown mattiaswelander /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /usr/sbin/chown -R mattiaswelander:admin /usr/local/Homebrew
Unexpected Git version: ''!
You must install Git before installing Homebrew. See:
https://docs.brew.sh/Installation