Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

brew update fails: Error: Git must be installed and in your PATH! #49736

Closed
hamiltop opened this issue Mar 2, 2016 · 4 comments
Closed

brew update fails: Error: Git must be installed and in your PATH! #49736

hamiltop opened this issue Mar 2, 2016 · 4 comments

Comments

@hamiltop
Copy link

hamiltop commented Mar 2, 2016

brew update
Warning: git-2.7.2 already installed
Error: Git must be installed and in your PATH!
brew doctor
Your system is ready to brew.

I can install packages but I can't update brew.

@tdsmith
Copy link
Contributor

tdsmith commented Mar 3, 2016

What's which -a git say?

Does this persist after running cd $(brew --repository) && git pull?

@hamiltop
Copy link
Author

hamiltop commented Mar 3, 2016

bash-3.2$ which -a git
/usr/local/bin/git
/usr/local/bin/git
/usr/bin/git
/usr/local/bin/git
/usr/bin/git
/usr/local/bin/git
/usr/local [  cd $(brew --repository) && git pull                                   master ] 7:50 PM
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

/usr/local [ brew update                                                            master ] 7:50 PM
Warning: git-2.7.2 already installed
Error: Git must be installed and in your PATH!
/usr/local [ git pull origin master                                                 master ] 7:51 PM
From https://github.com/Homebrew/homebrew
 * branch            master     -> FETCH_HEAD
Updating a928ede..ffa00b3
Fast-forward
 Library/Formula/clamav.rb    | 10 +++++-----
 Library/Formula/emacs.rb     |  4 ++--
 Library/Formula/flow.rb      | 10 +++++-----
 Library/Formula/irssi.rb     | 30 +++++++++---------------------
 Library/Formula/mercurial.rb | 10 +++++-----
 Library/Formula/node.rb      | 10 +++++-----
 Library/Formula/sslscan.rb   | 17 +++++++----------
 Library/Formula/unbound.rb   | 10 +++++-----
 8 files changed, 43 insertions(+), 58 deletions(-)
/usr/local [ brew update                                                            master ] 7:52 PM
Warning: git-2.7.2 already installed
Error: Git must be installed and in your PATH!

@hamiltop
Copy link
Author

hamiltop commented Mar 3, 2016

I figured it out.

I had GIT set to my personal git server in my bashrc. (To make git $GIT/repo a nice short command)

It looks like e942726 introduced GIT as a new env variable. I was able to update to that version, but was unable to update again. I removed my env var and everything was dandy.

@hamiltop hamiltop closed this as completed Mar 3, 2016
@preston
Copy link

preston commented Mar 14, 2016

Ahhhh... yeah, would've been nice to have a more useful warning about this. :) I just renamed my existing $GIT to $GIT_HOME, and all is well. Thanks!

andreaswachowski pushed a commit to andreaswachowski/dotfiles that referenced this issue Mar 21, 2016
nthdegreeburns added a commit to nthdegreeburns/dotfiles that referenced this issue Apr 11, 2016
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants