Recently a vulnerability in Git was discovered that could lead to arbitrary code execution when a developer utilizes a malicious repository. The good news is that this issue has been patched and the fix is available in version 2.17.1.
- Brew update Yes, run it twice to make sure all dependencies took. Each run can take several minutes.
- After running brew upgrade, you may notice some casks you think should be upgrading, aren’t. As you’re likely aware, a lot of macOS software can upgrade itself: That could cause conflicts when used in tandem with Homebrew Cask’s upgrade mechanism.
Now let’s upgrade!
Overview
Choose a name for the update site (Scala IDE is an obvious choice). Then read the next section to select which version you will install. Choosing what version to install. The list of URLs of the different update sites are available in the download area. The release ones are in the current section.
In this guide we are going to walk through how to upgrade Git via Homebrew. First we will install Homebrew and then install Git. Given that you may have Git already installed (e.g. via XCode), this guide will also walk you through how to change your path to use the official (non-Apple) distribution.
A few details before we get started:
If you are unfamiliar with Homebrew, it is a package manager for Mac that allows you to easily install and utilize a myriad a programs (i.e. Apple imac update 2020. formulae).
- For this guide, I am assuming you are running MacOS 10.11 or higher
- Additionally, check out the full Homebrew system requirements here before diving in
Step by Step Guide
Install Homebrew
if Homebrew is already installed, you can skip to the Git section
For installation details, including system requirements check out the documentation here
Update Homebrew to ensure you are on the latest version
Run brew doctor to ensure everything is good to go
If all is well, the output should say Your system is ready to brew.
Now let’s get to Git.
Check your current version of git
If the version of git says something like git version 2.15.1 (Apple Git-101)
then you are running the Apple version of Git, not the official distribution.
No worries, Homebrew has got us covered.
Install git via Homebrew
Change your local path to the Homebrew version
Check the git version
You should now see the current version of git, such as git version 2.17.1
.
To upgrade in the future, simply run
Conclusion
We are all set! Homebrew is installed, Git is installed, and we have changed our path to point to the current version. For further details on Homebrew and some additional resources, check out the links below.
Macos Brew Update Hangs
Additional Resources
Macos Brew Update All
- Updating paths for Git on StackOverflow