Getting Git on MacOS
On certain older versions of MacOS one needs to get the right version of git.
Check the version
Check if you have the right version of ``git` <gettingGit>`_.
Macs come with git pre-installed.
You can open terminal and type
git --version
to see what version of git you have.
It is most likely outdated if you’ve never used git before.
Get the right version
To get the latest version visit this site .
To tell your computer to use the correct version of git,
we need to do the following :
Open
terminaland do the following to bring yourself to your home “directory”.cdDo the following to show all files in this “directory”.
ls -la
Amongst these we are interested in a file called
.zprofileor.bash_profileif your mac is older.Look at the top of your terminal window and you should see
zshorbashif you’re on an older mac. This is the “shell” that your mac is using forterminal. If it iszsh,open .zprofile
This should open the file
.zprofilewithtext editor. Now add the following to the end of the fileIf you terminal was using
bashinstead, doopen .bash_profile
This should open
.bash_profilewithtext editor. Now add the the following to the end of the fileOnce you’ve done this, save the files and close them.
Restart
terminaland do the following againYou should see the version has now updated.