Skip to content

Instantly share code, notes, and snippets.

@hanxue
Created April 25, 2014 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanxue/11283297 to your computer and use it in GitHub Desktop.
Save hanxue/11283297 to your computer and use it in GitHub Desktop.
Brew update error: Your local changes to the following files would be overwritten by merge
#!/bin/sh
BREW_FILE_DIRECTORY=$(dirname "$0")
BREW_FILE_DIRECTORY=$(cd "$BREW_FILE_DIRECTORY" && pwd -P)
BREW_FILENAME=$(basename "$0")
export HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/$BREW_FILENAME"
BREW_SYMLINK=$(readlink $0)
if [ -n "$BREW_SYMLINK" ]
then
BREW_SYMLINK_DIRECTORY=$(dirname "$BREW_SYMLINK")
BREW_FILE_DIRECTORY=$(cd "$BREW_FILE_DIRECTORY" &&
cd "$BREW_SYMLINK_DIRECTORY" && pwd -P)
fi
BREW_LIBRARY_DIRECTORY=$(cd "$BREW_FILE_DIRECTORY"/../Library && pwd -P)
# Users may have these set, pointing the system Ruby
# at non-system gem paths
unset GEM_HOME
unset GEM_PATH
BREW_SYSTEM=$(uname -s | tr "[:upper:]" "[:lower:]")
if [ "$BREW_SYSTEM" = "darwin" ]
then
exec "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"
else
exec ruby -W0 "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"
fi
$ brew update
Pruned 737 dead formula
Warning: Could not tap darinmorrison/homebrew-haskell/cabal-install over Homebrew/homebrew/cabal-install
Warning: Could not tap darinmorrison/homebrew-haskell/ghc over Homebrew/homebrew/ghc
Warning: Could not tap homebrew/homebrew-boneyard/jad over homebrew/homebrew-binary/jad
Tapped 737 formula
Updated Homebrew from 726d3d9d to 726d3d9d.
==> New Formulae
caskroom/versions/camtwist-beta phinze/cask/mixture
phinze/cask/factor phinze/cask/screenstagram
phinze/cask/figtree phinze/cask/teensy
phinze/cask/jaspersoft-studio phinze/cask/torpedo
$ brew update
error: Your local changes to the following files would be overwritten by merge:
Library/Contributions/brew_bash_completion.sh
Library/Contributions/brew_fish_completion.fish
Library/Contributions/cmd/brew-test-bot.rb
Library/ENV/4.3/cc
Library/Formula/akka.rb
Library/Formula/arangodb.rb
Library/Formula/awscli.rb
Library/Formula/basex.rb
Library/Formula/cassandra.rb
Library/Formula/ccextractor.rb
Library/Formula/chisel.rb
Library/Formula/concurrencykit.rb
Library/Formula/dar.rb
Library/Formula/dos2unix.rb
Library/Formula/ettercap.rb
Library/Formula/ghc.rb
Library/Formula/gifsicle.rb
Library/Formula/go.rb
Library/Formula/grass.rb
Library/Formula/gst-libav.rb
Library/Formula/gst-plugins-bad.rb
Library/Formula/gst-plugins-base.rb
Library/Formula/gst-plugins-good.rb
Library/Formula/gst-plugins-ugly.rb
Library/Formula/gstreamer.rb
Library/Formula/hadoop.rb
Library/Formula/hive.rb
Library/Formula/libarchive.rb
Library/Formula/mg.rb
Library/Formula/multimarkdown.rb
Library/Formula/nexus.rb
Library/Formula/nginx.rb
Library/Formula/nvm.rb
Library/Formula/open-ocd.rb
Library/Formula/openssl.rb
Library/Formula/predictionio.rb
Library/Formula/rakudo-star.rb
Library/Formula/rethinkdb.rb
Library/Formula/ruby.rb
Library/Formula/swi-prolog.rb
Library/Formula/tree.rb
Library/Formula/typesafe-activator.rb
Library/Formula/unison.rb
Library/Formula/vowpal-wabbit.rb
Library/Formula/webp.rb
Library/Formula/x264.rb
Library/Homebrew/cmd/info.rb
Library/Homebrew/cmd/search.rb
Library/Homebrew/cmd/tap.rb
Library/Homebrew/cmd/untap.rb
Library/Homebrew/cmd/update.rb
Library/Homebrew/cmd/versions.rb
Library/Homebrew/compat/formula.rb
Library/Homebrew/cxxstdlib.rb
Library/Homebrew/exceptions.rb
Library/Homebrew/extend/ENV/shared.rb
Library/Homebrew/extend/ENV/std.rb
Library/Homebrew/extend/ENV/super.rb
Library/Homebrew/formula.rb
Library/Homebrew/formulary.rb
Library/Homebrew/global.rb
Library/Homebrew/os/mac.rb
Library/Homebrew/tap_migrations.rb
Library/Homebrew/test/fixtures/updater_fixture.yaml
Library/Homebrew/test/test_stdlib.rb
Library/Homebrew/test/test_updater.rb
Library/Homebrew/test/testing_env.rb
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
Library/Formula/ant-contrib.rb
Library/Formula/flvmeta.rb
Library/Formula/gcc.rb
Library/Formula/mpdviz.rb
Library/Formula/tmux-cssh.rb
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
$ brew update
Pruned 737 dead formula
Warning: Could not tap darinmorrison/homebrew-haskell/cabal-install over Homebrew/homebrew/cabal-install
Warning: Could not tap darinmorrison/homebrew-haskell/ghc over Homebrew/homebrew/ghc
Warning: Could not tap homebrew/homebrew-boneyard/jad over homebrew/homebrew-binary/jad
Tapped 737 formula
Updated Homebrew from 726d3d9d to 726d3d9d.
==> New Formulae
caskroom/versions/camtwist-beta phinze/cask/mixture
phinze/cask/factor phinze/cask/screenstagram
phinze/cask/figtree phinze/cask/teensy
phinze/cask/jaspersoft-studio phinze/cask/torpedo
$ sudo git reset --hard origin/master
HEAD is now at 726d3d9 swi-prolog: optional libarchive support
$ cd /usr/local/Library
$ git reset --hard origin/master
error: unable to unlink old '.gitignore' (Permission denied)
error: unable to create file LICENSE.txt (Permission denied)
error: unable to unlink old 'README.md' (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment