How do I update Homebrew?

When I ran:

brew update

I got a message saying it initialized an empty repository in /usr/local/.git/, then I got this error:

  • Cygwin gitk issue
  • Git pushing to remote GitHub repository as wrong user
  • Stuck in either a headless state or at the start of the branch in git
  • Merge conflict with myself
  • Sharing code between two different git projects
  • How does git store duplicate files?
  • Screenshot

  • How can I ignore this file “g4server.properties”
  • I need git-svn to act as a Subversion v1.5+ client
  • Add ignored file to repo but don't track afterwards
  • Ruby on Rails - Git Branch Workflow
  • Why does git status show branch is up-to-date when changes exist upstream?
  • Git2Go Fetch or Hard Pull
  • 2 Solutions collect form web for “How do I update Homebrew?”

    • cd /usr/local
    • git status
    • Discard all the changes (unless you actually want to try to commit to Homebrew – you probably don’t)
    • git status til it’s clean
    • brew update

    Alternatively you could update brew by installing it again. (Think I did this as El Capitan changed something)

    Note: this is a heavy handed approach that will remove all applications installed via brew!

    Try to install brew a fresh and it will tell how to uninstall.

    At original time of writing to uninstall:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
    
    Git Baby is a git and github fan, let's start git clone.