brew update.brew doctor.$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.
$ brew update
Warning: git-2.9.1 already installed
Error: Git must be installed and in your PATH!
$ brew -v
Homebrew 0.9.9 (git revision a02b; last commit 2016-07-15)
Homebrew/homebrew-core (git revision 2031; last commit 2016-07-15)
$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
I also tried brew uninstall git and brew update after that and got the same error after brew installed git for me. Please let me know if I can provide any more information.
Me too. After brew uninstall git, brew update re-installs git and fails again with this error.
cd $(brew --prefix) && git fetch && git reset --hard origin/master
Will only need to execute that once & you'll be okay afterwards. You can also brew rm git if you're happy with the system git; was never intentionally made mandatory.
Sorry about that!
Had the same problem after upgrading to High Sierra. Above steps did not fix, but I ran xcode-select --install and completed command line tools installation. This solved for me.
Most helpful comment
Had the same problem after upgrading to High Sierra. Above steps did not fix, but I ran
xcode-select --installand completed command line tools installation. This solved for me.