When trying to deploy an app to heroku using git push heroku main
There was an error
>> git push heroku main
remote: ! Heroku does not support Git client version git/2.39.3 (Apple Git-146).
remote: ! Please upgrade to the latest Git version.
remote: ! For more information, please see https://help.heroku.com/GJ1XRFT5/fatal-error-pushing-to-heroku-on-macos-with-git-2-39-3-apple-git-146
fatal: unable to access 'https://git.heroku.com/peaceful-brook-74638.git/': The requested URL returned error: 400
I tried fixing the issue with
>> brew update
>> brew upgrade git
And ran git push heroku main
again, but the error still persists
The solution is to install git through homebrew with brew install git
and overwrite the Apple git
preinstalled with the Mac.
The brew update git
command probably failed with an error message like
>>> brew update git
brew upgrade git
Error: git not installed
...
Steps:
-
Run
brew install git
-
Add the following line to your shell configuration file (e.g., .bashrc, .zshrc, etc.):
export PATH="/usr/local/bin:$PATH"
- Reload your shell configuration
source ~/.zshrc
- Run
git --version
to verify the updated git installed.