This repository has been archived by the owner. It is now read-only.

Cannot "brew update" anymore - fails to git pull formulas #11448

Closed
MPV opened this Issue Apr 4, 2012 · 59 comments

Comments

Projects
None yet
@MPV

MPV commented Apr 4, 2012

EDIT: The TLDR solution:

cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master

The story behind it:

Hi,
Recently I started getting this output when I run "brew update".
I can't recall having done anything special that would affect my homebrew installation.

$ brew update
error: Your local changes to the following files would be overwritten by merge:
    Library/Aliases/bjam
    Library/Aliases/gpg2
    Library/Contributions/brew_bash_completion.sh
    Library/Contributions/manpages/brew.1.md
    Library/Formula/a2ps.rb
    Library/Formula/aalib.rb
    Library/Formula/abcde.rb
    Library/Formula/abiword.rb
    Library/Formula/abook.rb
    Library/Formula/abuse.rb
    Library/Formula/ace.rb
    Library/Formula/ack.rb
    Library/Formula/activemq.rb
    Library/Formula/adobe-air-sdk.rb
    Library/Formula/advancecomp.rb
    Library/Formula/aescrypt.rb
    Library/Formula/afsctool.rb
    Library/Formula/aften.rb
    Library/Formula/aget.rb
    Library/Formula/aggregate.rb
    Library/Formula/agrep.rb
    Library/Formula/aircrack-ng.rb
    Library/Formula/aldo.rb
    Library/Formula/algol68g.rb
    Library/Formula/alpine.rb
    Library/Formula/amap.rb
    Library/Formula/android-sdk.rb
    Library/Formula/ann.rb
    Library/Formula/ansifilter.rb
    Library/Formula/antiword.rb
    Library/Formula/antlr.rb
    Library/Formula/anttweakbar.rb
    Library/Formula/aoeui.rb
    Library/Formula/apg.rb
    Library/Formula/apgdiff.rb
    Library/Formula/apiextractor.rb
    Library/Formula/apktool.rb
    Library/Formula/aplus.rb
    Library/Formula/app-engine-java-sdk.rb
    Library/Formula/apt-dater.rb
    Library/Formula/aqbanking.rb
    Library/Formula/arabica.rb
    Library/Formula/aria2.rb
    Library/Formula/arm.rb
    Library/Formula/armadillo.rb
    Library/Formula/arping.rb
    Library/Formula/arss.rb
    Library/Formula/assimp.rb
    Library/Formula/astyle.rb
    Library/Formula/asymptote.rb
    Library/Formula/aterm.rb
    Library/Formula/atk.rb
    Library/Formula/atlassian-plugin-sdk.rb
    Library/Formula/atomicparsley.rb
    Library/Formula/atool.rb
    Library/Formula/auctex.rb
    Library/Formula/audiofile.rb
    Library/Formula/authexec.rb
    Library/Formula/auto-scaling.rb
    Library/Formula/autobench.rb
    Library/Formula/autogen.rb
    Library/Formula/automoc4.rb
    Library/Formula/autossh.rb
    Library/Formula/aview.rb
    Library/Formula/avra.rb
    Library/Formula/avro-c.rb
    Library/Formula/aws-cfn-tools.rb
    Library/Formula/aws-elasticache.rb
    Library/Formula/aws-iam-tools.rb
    Library/Formula/babl.rb
    Library/Formula/bagit.rb
    Library/Formula/bali-phy.rb
    Library/Formula/bash-completion.rb
    Library/Formula/bazaar.rb
    Library/Formula/bbcp.rb
    Library/Formula/bcrypt.rb
    Library/Formula/bcwipe.rb
    Library/Formula/bdw-gc.rb
    Library/Formula/beanstalk.rb
    Library/Formula/bedtools.rb
    Library/Formula/berkeley-db.rb
    Library/Formula/bibutils.rb
    Library/Formula/binutils.rb
    Library/Formula/binwalk.rb
    Library/Formula/bitlbee.rb
    Library/Formula/blahtexml.rb
    Library/Formula/blast.rb
    Library/Formula/blitz.rb
    Library/Formula/blueutil.rb
    Library/Formula/boost.rb
    Library/Formula/botan.rb
    Library/Formula/box2d.rb
    Library/Formula/boxes.rb
    Library/Formula/bsdiff.rb
    Library/Formula/bulk_extractor.rb
    Library/Formula/bwa.rb
    Library/Formula/bwm-ng.rb
    Library/Formula/byobu.rb
    Library/Formula/c10t.rb
    Library/Formula/cabal-install.rb
    Library/Formula/cadaver.rb
    Library/Formula/cairo.rb
    Library/Formula/cairomm.rb
    Library/Formula/calabash.rb
    Library/Formula/cantera.rb
    Library/Formula/cassandra.rb
    Library/Formula/cc65.rb
    Library/Formula/cdargs.rb
    Library/Formula/cdecl.rb
    Library/Formula/cdrdao.rb
    Library/Formula/ceylon.rb
    Library/Formula/cfengine.rb
    Library/Formula/cfitsio.rb
    Library/Formula/cgal.rb
    Library/Formula/cgdb.rb
    Library/Formula/cheops.rb
    Library/Formula/chibi-scheme.rb
    Library/Formula/chipmunk.rb
    Library/Formula/chkrootkit.rb
    Library/Formula/chromaprint.rb
    Library/Formula/cimg.rb
    Library/Formula/clay.rb
    Library/Formula/clisp.rb
    Library/Formula/cloc.rb
    Library/Formula/closure-compiler.rb
    Library/Formula/cloud-watch.rb
    Library/Formula/cloudbees-sdk.rb
    Library/Formula/clozure-cl.rb
    Library/Formula/clucene.rb
    Library/Formula/clusterit.rb
    Library/Formula/clutter.rb
    Library/Formula/cmake.rb
    Library/Formula/cmigemo.rb
    Library/Formula/cminpack.rb
    Library/Formula/cmu-pocketsphinx.rb
    Library/Formula/cmu-sphinxbase.rb
    Library/Formula/cmucl.rb
    Library/Formula/cmus.rb
    Library/Formula/coffee-script.rb
    Library/Formula/collectd.rb
    Library/Formula/co
error: The following untracked working tree files would be overwritten by merge:
    Library/Aliases/boost-jam
    Library/Aliases/fastcgi
    Library/Aliases/nodejs
    Library/Aliases/pocketsphinx
    Library/Aliases/sphinxbase
    Library/Contributions/cmds/brew-beer.rb
    Library/Contributions/cmds/brew-dirty.rb
    Library/Contributions/cmds/brew-graph
    Library/Contributions/cmds/brew-grep
    Library/Contributions/cmds/brew-leaves.rb
    Library/Contributions/cmds/brew-linkapps.rb
    Library/Contributions/cmds/brew-man
    Library/Contributions/cmds/brew-mirror-check.rb
    Library/Contributions/cmds/brew-missing.rb
    Library/Contributions/cmds/brew-pull.rb
    Library/Contributions/cmds/brew-readall.rb
    Library/Contributions/cmds/brew-server
    Library/Contributions/cmds/brew-switch.rb
    Library/Contributions/cmds/brew-unpack.rb
    Library/Contributions/cmds/brew-which.rb
    Library/Contributions/install_homebrew.rb
    Library/Formula/abcl.rb
    Library/Formula/ape.rb
    Library/Formula/apollo.rb
    Library/Formula/appledoc.rb
    Library/Formula/arp-scan.rb
    Library/Formula/atkmm.rb
    Library/Formula/autoconf.rb
    Library/Formula/autoenv.rb
    Library/Formula/autojump.rb
    Library/Formula/automake.rb
    Library/Formula/avocadodb.rb
    Library/Formula/blackbox.rb
    Library/Formula/boost-build.rb
    Library/Formula/bro.rb
    Library/Formula/bsdmake.rb
    Library/Formula/cbmbasic.rb
    Library/Formula/cloog.rb
    Library/Formula/conserver.rb
    Library/Formula/crush-tools.rb
    Library/Formula/dart.rb
    Library/Formula/di.rb
    Library/Formula/dsniff.rb
    Library/Formula/dupx.rb
    Library/Formula/echoping.rb
    Library/Formula/ecm.rb
    Library/Formula/eprover.rb
    Library/Formula/ext2fuse.rb
    Library/Formula/ezlupdate.rb
    Library/Formula/f3.rb
    Library/Formula/fasd.rb
    Library/Formula/fceux.rb
    Library/Formula/fcgi.rb
    Library/Formula/findbugs.rb
    Library/Formula/freerdp.rb
    Library/Formula/funcoeszz.rb
    Library/Formula/gabedit.rb
    Library/Formula/gibbslda.rb
    Library/Formula/git-diffall.rb
    Library/Formula/git-ftp.rb
    Library/Formula/gnu-arch.rb
    Library/Formula/gnumeric.rb
    Library/Formula/gnunet.rb
    Library/Formula/go-app-engine-32.rb
    Library/Formula/go-app-engine-64.rb
    Library/Formula/goffice.rb
    Library/Formula/grace.rb
    Library/Formula/grib-api.rb
    Library/Formula/griffon.rb
    Library/Formula/gtk-doc.rb
    Library/Formula/gtmess.rb
    Library/Formula/hg-flow.rb
    Library/Formula/hqx.rb
    Library/Formula/imap-uw.rb
    Library/Formula/ispell.rb
    Library/Formula/ivy.rb
    Library/Formula/jing.rb
    Library/Formula/knife-completion.rb
    Library/Formula/konoha.rb
    Library/Formula/libcouchbase.rb
    Library/Formula/libcuefile.rb
    Library/Formula/libextractor.rb
    Library/Formula/libgaiagraphics.rb
    Library/Formula/libgnomecanvas.rb
    Library/Formula/libkate.rb
    Library/Formula/libqalculate.rb
    Library/Formula/libreplaygain.rb
    Library/Formula/libtool.rb
    Library/Formula/libvbucket.rb
    Library/Formula/lifelines.rb
    Library/Formula/mdxmini.rb
    Library/Formula/meld.rb
    Library/Formula/minuit2.rb
    Library/Formula/mobile-shell.rb
    Library/Formula/monetdb.rb
    Library/Formula/mp3info.rb
    Library/Formula/mpio.rb
    Library/Formula/msgpack-rpc.rb
    Library/Formula/musepack.rb
    Library/Formula/nacl.rb
    Library/Formula/nauty.rb
    Library/Formula/nrpe.rb
    Library/Formula/num-utils.rb
    Library/Formula/oath-toolkit.rb
    Library/Formula/open-babel.rb
    Library/Formula/orbit.rb
    Library/Formula/par2tbb.rb
    Library/Formula/pcb.rb
    Library/Formula/pdksh.rb
    Library/Formula/perforce-proxy.rb
    Library/Formula/pgdbf.rb
    Library/Formula/phyml.rb
    Library/Formula/pmdmini.rb
    Library/Formula/primesieve.rb
    Library/Formula/pulledpork.rb
    Library/Formula/py2cairo.rb
    Library/Formula/pygobject.rb
    Library/Formula/pygtk.rb
    Library/Formula/quickfix.rb
    Library/Formula/rarian.rb
    Library/Formula/rc.rb
    Library/Formula/riemann.rb
    Library/Formula/rsense.rb
    Library/Formula/sam2p.rb
    Library/Formula/savana.rb
    Library/Formula/sdl_rtf.rb
    Library/Formula/selenium-server-standalone.rb
    Library/Formula/skytools.rb
    Library/Formula/sonar.rb
    Library/Formula/tcpurify.rb
    Library/Formula/the_silver_searcher.rb
    Library/Formula/tkdiff.rb
    Library/Formula/trang.rb
    Librar
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
@MPV

This comment has been minimized.

Show comment
Hide comment
@MPV

MPV Apr 4, 2012

I tried asking the doctor but he was not happy. Where do I even begin?

$ brew doctor
Warning: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.

Warning: You have Xcode 4.1, which is outdated.
Please install Xcode 4.3.

Warning: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libmacfuse_i32.2.dylib    /usr/local/lib/libmacfuse_i64.2.dylib    /usr/local/lib/libosxfuse_i32.2.dylib    /usr/local/lib/libosxfuse_i64.2.dylib    /usr/local/lib/libusb-0.1.4.4.4.dylib    /usr/local/lib/libusbpp-0.1.4.4.4.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libosxfuse_i32.la    /usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/osxfuse.pc

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built.

    a52dec
    aalib
    atk
    cdparanoia
    check
    cmake
    dirac
    flac
    gdk-pixbuf
    git
    gst-plugins-base
    gst-plugins-good
    gst-plugins-ugly
    gstreamer
    gtk+
    jansson
    jasper
    lame
    libcaca
    libcdio
    libdv
    libdvdcss
    libdvdread
    libevent
    libmms
    libmpdclient
    libmpeg2
    libogg
    liboil
    libshout
    libtiff
    libvorbis
    mad
    mcrypt
    mpc
    mtr
    mysql
    orc
    pango
    php
    pidof
    pkg-config
    popt
    sdl
    speex
    sqlite
    taglib
    theora
    tree
    two-lame
    wget
    xdebug

Warning: You have uncommitted modifications to Homebrew's core.
Unless you know what you are doing, you should run:
  cd /usr/local && git reset --hard

Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:

    brew install xz pixman cairo yasm x264

Run `brew missing` for more details.

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    git
    git-cvsserver
    git-receive-pack
    git-shell
    git-upload-archive
    git-upload-pack
    gitk
    sqlite3
    svn
    svnadmin
    svndumpfilter
    svnlook
    svnserve
    svnsync
    svnversion

Consider ammending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.

Warning: Homebrew's sbin was not found in your path.
Consider ammending your PATH variable so it contains:
  /usr/local/sbin

MPV commented Apr 4, 2012

I tried asking the doctor but he was not happy. Where do I even begin?

$ brew doctor
Warning: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.

Warning: You have Xcode 4.1, which is outdated.
Please install Xcode 4.3.

Warning: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libmacfuse_i32.2.dylib    /usr/local/lib/libmacfuse_i64.2.dylib    /usr/local/lib/libosxfuse_i32.2.dylib    /usr/local/lib/libosxfuse_i64.2.dylib    /usr/local/lib/libusb-0.1.4.4.4.dylib    /usr/local/lib/libusbpp-0.1.4.4.4.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libosxfuse_i32.la    /usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/osxfuse.pc

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built.

    a52dec
    aalib
    atk
    cdparanoia
    check
    cmake
    dirac
    flac
    gdk-pixbuf
    git
    gst-plugins-base
    gst-plugins-good
    gst-plugins-ugly
    gstreamer
    gtk+
    jansson
    jasper
    lame
    libcaca
    libcdio
    libdv
    libdvdcss
    libdvdread
    libevent
    libmms
    libmpdclient
    libmpeg2
    libogg
    liboil
    libshout
    libtiff
    libvorbis
    mad
    mcrypt
    mpc
    mtr
    mysql
    orc
    pango
    php
    pidof
    pkg-config
    popt
    sdl
    speex
    sqlite
    taglib
    theora
    tree
    two-lame
    wget
    xdebug

Warning: You have uncommitted modifications to Homebrew's core.
Unless you know what you are doing, you should run:
  cd /usr/local && git reset --hard

Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:

    brew install xz pixman cairo yasm x264

Run `brew missing` for more details.

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    git
    git-cvsserver
    git-receive-pack
    git-shell
    git-upload-archive
    git-upload-pack
    gitk
    sqlite3
    svn
    svnadmin
    svndumpfilter
    svnlook
    svnserve
    svnsync
    svnversion

Consider ammending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.

Warning: Homebrew's sbin was not found in your path.
Consider ammending your PATH variable so it contains:
  /usr/local/sbin
@MPV

This comment has been minimized.

Show comment
Hide comment
@MPV

MPV Apr 4, 2012

Oh, and here is the brew env & config:

$ brew --env ; brew --config
CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CFLAGS: -O3 -w -pipe -march=core2 -msse4.1
CXXFLAGS: -O3 -w -pipe -march=core2 -msse4.1
MAKEFLAGS: -j2
HOMEBREW_VERSION: 0.8.1
HEAD: c3bf616a3d46a6ca72c03db3517dd53d92250511
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
Hardware: dual-core 64-bit penryn
OS X: 10.7.3
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 4.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2335
Clang: 2.1 build 163
MacPorts or Fink? false
X11 installed? true

MPV commented Apr 4, 2012

Oh, and here is the brew env & config:

$ brew --env ; brew --config
CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CFLAGS: -O3 -w -pipe -march=core2 -msse4.1
CXXFLAGS: -O3 -w -pipe -march=core2 -msse4.1
MAKEFLAGS: -j2
HOMEBREW_VERSION: 0.8.1
HEAD: c3bf616a3d46a6ca72c03db3517dd53d92250511
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
Hardware: dual-core 64-bit penryn
OS X: 10.7.3
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 4.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2335
Clang: 2.1 build 163
MacPorts or Fink? false
X11 installed? true
@MPV

This comment has been minimized.

Show comment
Hide comment
@MPV

MPV Apr 4, 2012

Solved by running:

cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master

MPV commented Apr 4, 2012

Solved by running:

cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master

@MPV MPV closed this Apr 4, 2012

@anselmo

This comment has been minimized.

Show comment
Hide comment
@anselmo

anselmo Aug 3, 2012

MPV - Awesome solution.

anselmo commented Aug 3, 2012

MPV - Awesome solution.

@alduro

This comment has been minimized.

Show comment
Hide comment
@alduro

alduro Aug 10, 2012

MVP clap clap !

alduro commented Aug 10, 2012

MVP clap clap !

@rahul286

This comment has been minimized.

Show comment
Hide comment
@rahul286

rahul286 Aug 14, 2012

@MPV worked nicely. Thanks :-)

@MPV worked nicely. Thanks :-)

@alcarvalho

This comment has been minimized.

Show comment
Hide comment
@alcarvalho

alcarvalho Aug 15, 2012

Some kind of 'brew update --force' would be very helpful. It would perform exactly this code.

Some kind of 'brew update --force' would be very helpful. It would perform exactly this code.

@chadcdavis

This comment has been minimized.

Show comment
Hide comment
@chadcdavis

chadcdavis Aug 26, 2012

Agreed @alcarvalho ... the non-existant 'brew update --force' is exactly what I tried before googling.

Thanks for the tip @MPV!

Agreed @alcarvalho ... the non-existant 'brew update --force' is exactly what I tried before googling.

Thanks for the tip @MPV!

@zerodie

This comment has been minimized.

Show comment
Hide comment
@zerodie

zerodie Sep 18, 2012

@MPV It works! thank you :-)

zerodie commented Sep 18, 2012

@MPV It works! thank you :-)

@fender21

This comment has been minimized.

Show comment
Hide comment
@fender21

fender21 Sep 27, 2012

THANK YOU MPV! I have been trying to resolve this for days now!

THANK YOU MPV! I have been trying to resolve this for days now!

@seigel

This comment has been minimized.

Show comment
Hide comment

seigel commented Oct 30, 2012

Awesome

@grayghostvisuals

This comment has been minimized.

Show comment
Hide comment
@grayghostvisuals

grayghostvisuals Oct 30, 2012

Yeah that did the trick. Awesome! Thanks for posting the solution.

Yeah that did the trick. Awesome! Thanks for posting the solution.

@pekpon

This comment has been minimized.

Show comment
Hide comment
@pekpon

pekpon Nov 7, 2012

thanks @MPV !!!!!

pekpon commented Nov 7, 2012

thanks @MPV !!!!!

@carstenevers

This comment has been minimized.

Show comment
Hide comment
@carstenevers

carstenevers Nov 11, 2012

Thanks - worked also for me. :-)

Thanks - worked also for me. :-)

@mikepack

This comment has been minimized.

Show comment
Hide comment
@mikepack

mikepack Nov 25, 2012

Perfect, thanks @MPV!

Perfect, thanks @MPV!

@artxgj

This comment has been minimized.

Show comment
Hide comment
@artxgj

artxgj Nov 29, 2012

Thank you!!!

artxgj commented Nov 29, 2012

Thank you!!!

@slant

This comment has been minimized.

Show comment
Hide comment
@slant

slant Dec 2, 2012

Very nice solution! On a side note, I only had to do the following as my origin was already set correctly.

cd `brew --prefix`
git fetch origin
git reset --hard origin/master

I only mention this for posterity sake. For those of you who do not know this, you can check to see what your origin is currently set to with the following:

git remote show origin

Or simply look in your .git/config file in the [remote "origin"] section for the url entry.

That said, it is just as easy to simply use the command from @MPV that I left out (git remote add origin https://github.com/mxcl/homebrew.git) to just explicitly set it. As I mentioned before, I only wrote this out to help those who care to understand more about this, so I hope it helps someone!

slant commented Dec 2, 2012

Very nice solution! On a side note, I only had to do the following as my origin was already set correctly.

cd `brew --prefix`
git fetch origin
git reset --hard origin/master

I only mention this for posterity sake. For those of you who do not know this, you can check to see what your origin is currently set to with the following:

git remote show origin

Or simply look in your .git/config file in the [remote "origin"] section for the url entry.

That said, it is just as easy to simply use the command from @MPV that I left out (git remote add origin https://github.com/mxcl/homebrew.git) to just explicitly set it. As I mentioned before, I only wrote this out to help those who care to understand more about this, so I hope it helps someone!

@strand

This comment has been minimized.

Show comment
Hide comment
@strand

strand Jan 8, 2013

@MPV Thanks! Works like a charm!

strand commented Jan 8, 2013

@MPV Thanks! Works like a charm!

@raldred

This comment has been minimized.

Show comment
Hide comment
@raldred

raldred Jan 12, 2013

Contributor

Whilst the solution works, it's not a fix for the cause of the issue. So this continues to happen. Brew changes it's formula files locally for some reason.
I usually brew update whenever I remember probabaly about once a month, I have this issue or similar every time I brew update

The command gives up, surely it could just do this internally without user having to return to this thread everytime.

Contributor

raldred commented Jan 12, 2013

Whilst the solution works, it's not a fix for the cause of the issue. So this continues to happen. Brew changes it's formula files locally for some reason.
I usually brew update whenever I remember probabaly about once a month, I have this issue or similar every time I brew update

The command gives up, surely it could just do this internally without user having to return to this thread everytime.

@gkb

This comment has been minimized.

Show comment
Hide comment
@gkb

gkb Feb 1, 2013

Thank you for clearing this up.

gkb commented Feb 1, 2013

Thank you for clearing this up.

@eeldwin

This comment has been minimized.

Show comment
Hide comment
@eeldwin

eeldwin Feb 7, 2013

Thanks MPV, awesome solution

eeldwin commented Feb 7, 2013

Thanks MPV, awesome solution

@buk

This comment has been minimized.

Show comment
Hide comment
@buk

buk Feb 18, 2013

Thanks MPV

buk commented Feb 18, 2013

Thanks MPV

@hapticdata

This comment has been minimized.

Show comment
Hide comment

thanks @MPV!

@asabaylus

This comment has been minimized.

Show comment
Hide comment
@asabaylus

asabaylus Mar 24, 2013

fantastic!

fantastic!

@yishenggudou

This comment has been minimized.

Show comment
Hide comment

nice

@digitalformula

This comment has been minimized.

Show comment
Hide comment
@digitalformula

digitalformula Apr 14, 2013

Another +1. Thanks @MPV!

Another +1. Thanks @MPV!

@vandigroup

This comment has been minimized.

Show comment
Hide comment
@vandigroup

vandigroup Jun 8, 2013

Thanks @mvp. Worked perfectly...

Thanks @mvp. Worked perfectly...

@julienbourdeau

This comment has been minimized.

Show comment
Hide comment
@julienbourdeau

julienbourdeau Jul 5, 2013

Great! Thanks a lot!

Great! Thanks a lot!

@nesk

This comment has been minimized.

Show comment
Hide comment
@nesk

nesk Sep 4, 2013

Worked for me, thanks!

nesk commented Sep 4, 2013

Worked for me, thanks!

@denislutz

This comment has been minimized.

Show comment
Hide comment

Thx MPV!

@mathiasbynens

This comment has been minimized.

Show comment
Hide comment
@mathiasbynens

mathiasbynens Oct 2, 2013

Contributor

Could it be that you guys have a global .gitattributes file that normalizes the line endings in those formulas or something?

Contributor

mathiasbynens commented Oct 2, 2013

Could it be that you guys have a global .gitattributes file that normalizes the line endings in those formulas or something?

@jbudziak

This comment has been minimized.

Show comment
Hide comment
@jbudziak

jbudziak Oct 11, 2013

Thanks ! :)

Thanks ! :)

tlvince added a commit to tlvince/homebrew that referenced this issue Oct 25, 2013

Normalise line endings, add local .gitattributes
Setting `* text=auto`...

> ... ensures that all files that Git considers to be text will have normalized
> (LF) line endings in the repository
> -- [gitattributes(5)][5]

This should prevent issues such as those discussed in #11448 from cropping up.

See also [h5bp/html5-boilerplate#7f31896][h5bp].

  [5]: http://git-scm.com/docs/gitattributes
  [h5bp]: h5bp/html5-boilerplate@7f31896#commitcomment-525963
@chamnap

This comment has been minimized.

Show comment
Hide comment
@chamnap

chamnap Nov 19, 2013

Thanks :)

chamnap commented Nov 19, 2013

Thanks :)

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Dec 24, 2013

Works! Thank you so much.

ghost commented Dec 24, 2013

Works! Thank you so much.

@njj

This comment has been minimized.

Show comment
Hide comment

njj commented Dec 28, 2013

👍

@pkoht

This comment has been minimized.

Show comment
Hide comment

pkoht commented Jan 16, 2014

thanks @mvp!

@zoubeiri

This comment has been minimized.

Show comment
Hide comment

Thanks!

@yaronyosef

This comment has been minimized.

Show comment
Hide comment
@yaronyosef

yaronyosef Feb 2, 2014

thanks MPV!

thanks MPV!

@luruke

This comment has been minimized.

Show comment
Hide comment

luruke commented Feb 5, 2014

Thanks!

@wsvincent

This comment has been minimized.

Show comment
Hide comment
@wsvincent

wsvincent Feb 6, 2014

Lifesaver. Thanks!

Lifesaver. Thanks!

@reco

This comment has been minimized.

Show comment
Hide comment
@reco

reco Feb 6, 2014

same here thanks!!!

reco commented Feb 6, 2014

same here thanks!!!

@spotim-admin

This comment has been minimized.

Show comment
Hide comment

thanks

@todrobbins

This comment has been minimized.

Show comment
Hide comment
@todrobbins

todrobbins Feb 26, 2014

Thanks @MPV! Champion of my hour!

Thanks @MPV! Champion of my hour!

@Otoris

This comment has been minimized.

Show comment
Hide comment
@Otoris

Otoris Mar 4, 2014

2 years later and this still saves me @MPV!

Otoris commented Mar 4, 2014

2 years later and this still saves me @MPV!

@Preen

This comment has been minimized.

Show comment
Hide comment
@Preen

Preen Mar 24, 2014

@MPV - SWEET THANKS 💃

Preen commented Mar 24, 2014

@MPV - SWEET THANKS 💃

@bennyng

This comment has been minimized.

Show comment
Hide comment
@bennyng

bennyng Mar 30, 2014

@MPV nice, it helped me out!

bennyng commented Mar 30, 2014

@MPV nice, it helped me out!

@LeonFedotov

This comment has been minimized.

Show comment
Hide comment
@LeonFedotov

LeonFedotov Apr 6, 2014

also just:

cd `brew --prefix`; git reset --hard

also just:

cd `brew --prefix`; git reset --hard
@BitMangler

This comment has been minimized.

Show comment
Hide comment
@BitMangler

BitMangler Apr 7, 2014

@MPV...BIG thanks !!!

@MPV...BIG thanks !!!

@ajubayer

This comment has been minimized.

Show comment
Hide comment
@ajubayer

ajubayer Apr 12, 2014

Hi, I am getting a message
"Your local changes to the following files would be overwritten by merge: mod_python.rb Please commit your changes or stash them before you can merge. Aborting
Error: Failed to update tap: homebrew/apache
"
Anyone have any idea how to fix this issue?

Scenario: i transferred my apps from mac Air to mac Pro using migration utility. then when i started getting some issue with homebrew, I uninstalled and reinstalled homebrew on my mac. every thing else seems to be good and working now but these brew update issue is stopping me from lot other things. can someone help?

Hi, I am getting a message
"Your local changes to the following files would be overwritten by merge: mod_python.rb Please commit your changes or stash them before you can merge. Aborting
Error: Failed to update tap: homebrew/apache
"
Anyone have any idea how to fix this issue?

Scenario: i transferred my apps from mac Air to mac Pro using migration utility. then when i started getting some issue with homebrew, I uninstalled and reinstalled homebrew on my mac. every thing else seems to be good and working now but these brew update issue is stopping me from lot other things. can someone help?

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Apr 13, 2014

Member

@ajubayer cd $(brew --prefix); git fetch; git reset --hard origin/master (at your own risk)

Member

MikeMcQuaid commented Apr 13, 2014

@ajubayer cd $(brew --prefix); git fetch; git reset --hard origin/master (at your own risk)

@davidrinnan

This comment has been minimized.

Show comment
Hide comment

@MPV saved my day

@mschipperheyn

This comment has been minimized.

Show comment
Hide comment

perfect

@jesse-wang

This comment has been minimized.

Show comment
Hide comment
@jesse-wang

jesse-wang Jun 10, 2014

@MPV worked for me

@MPV worked for me

@AndyBean

This comment has been minimized.

Show comment
Hide comment
@AndyBean

AndyBean Jun 11, 2014

Thanks for the fix. I needed it even today on OSX 10.9. I even had to sudo the last command too, sudo git reset --hard origin/master

Thanks for the fix. I needed it even today on OSX 10.9. I even had to sudo the last command too, sudo git reset --hard origin/master

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Jun 12, 2014

Member

If you had to use sudo instead I recommend running before that: sudo chown -R $USER /usr/local

Member

MikeMcQuaid commented Jun 12, 2014

If you had to use sudo instead I recommend running before that: sudo chown -R $USER /usr/local

@wisnoo

This comment has been minimized.

Show comment
Hide comment
@wisnoo

wisnoo Jun 18, 2014

@MPV thanks.. solving my dead end this day :)

wisnoo commented Jun 18, 2014

@MPV thanks.. solving my dead end this day :)

@tigris

This comment has been minimized.

Show comment
Hide comment
@tigris

tigris Jun 20, 2014

Whilst this solution was awesome and worked for me too, I can't help but wonder how my homebrew got into modified state in the first place. I certainly didn't make the changes git status seemed to think I made.

tigris commented Jun 20, 2014

Whilst this solution was awesome and worked for me too, I can't help but wonder how my homebrew got into modified state in the first place. I certainly didn't make the changes git status seemed to think I made.

@grayghostvisuals

This comment has been minimized.

Show comment
Hide comment
@grayghostvisuals

grayghostvisuals Jun 20, 2014

Longest. Running. Issue. Thread. Ever.

Longest. Running. Issue. Thread. Ever.

@johnnygoodman

This comment has been minimized.

Show comment
Hide comment

@MPV thanks!

@Homebrew Homebrew locked and limited conversation to collaborators Jun 29, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.