bug: brew update won't work when initialized offline #2244

bakotaco opened this Issue Aug 20, 2010 · 11 comments


None yet

10 participants


When you first run brew update offline (without a network connection) it will git init /usr/local, however the fetch from github will fail:

$ brew update
Initialized empty Git repository in /usr/local/.git/
error: Couldn't resolve host 'github.com' while accessing http://github.com/mxcl/homebrew.git/info/refs

fatal: HTTP request failed

Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master

When one goes online again and retries to brew update this will still fail however:

$ brew update

error: pathspec 'master' did not match any file(s) known to git.
Error: Failure while executing: git checkout -q master 

After removing /usr/local/.git 'brew update' works again as expected


thanks, worked for me also

ghost commented Oct 17, 2010

Awesome, thank you.

adamv commented Oct 17, 2010

Hm, should be easy enough to make "brew update" self-repairing; if .git exists but there is no master branch, then reset it.

bakotaco commented Nov 7, 2010

Works perfect, thanks.

amiller commented Dec 23, 2010

I also had this problem and this solution worked.

cokron commented Jan 7, 2011

me too, it worked


yay it worked for me too! :D


I tried the solution but now I'm getting "Error: Failure while executing: git init" when running brew update

NVM - urns out the permissions on /usr/local were jacked. The brew install script fixed everything.

zeeraw commented Aug 24, 2011

Thanks that worked great.

covard commented Sep 17, 2011

I don't have /usr/local/.git and still get the error. Any help would be great thanks

~$brew update
Initialized empty Git repository in /usr/local/.git/
error: The requested URL returned error: 403 while accessing https://github.com/mxcl/homebrew.git/info/refs

fatal: HTTP request failed
Error: Failure while executing: git fetch origin
~$ls -l /usr/local/.git
ls: /usr/local/.git: No such file or directory

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.