-
-
Save mxcl/1173223 to your computer and use it in GitHub Desktop.
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e | |
/usr/bin/which -s git || abort "brew install git first!" | |
test -d /usr/local/.git || abort "brew update first!" | |
cd `brew --prefix` | |
git checkout master | |
git ls-files -z | pbcopy | |
rm -rf Cellar | |
bin/brew prune | |
pbpaste | xargs -0 rm | |
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions | |
test -d Library/LinkedKegs && rm -r Library/LinkedKegs | |
rmdir -p bin Library share/man/man1 2> /dev/null | |
rm -rf .git | |
rm -rf ~/Library/Caches/Homebrew | |
rm -rf ~/Library/Logs/Homebrew | |
rm -rf /Library/Caches/Homebrew |
I dot I remove a broken brew ?
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': /usr/local/Library/Homebrew/extend/pathname.rb:259: invalid multibyte escape: /^\037\213/ (SyntaxError) invalid multibyte escape: /^\037\235/ invalid multibyte escape: /^\xFD7zXZ\x00/ from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require'
from /usr/local/Library/Homebrew/global.rb:1:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/bin/brew:10:in
hi guys:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
so easy!
thanks jacknagel , that worked for me
the post from self-creative worked for me. sorry to necro a dead thread but i felt that needed to be said.
Thanks self-creative!
Thanks self-creative! Home brew managed to delete a project with my .git when I tried to commit. It installed poorly and reading through this thread was daunting. Glad I read to the bottom.
Thanks, @self-creative! You saved my time a lot.
For me this command worked! 🍺
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Also, do I need to remove the .git directory at /usr/local/ as well? Is .git only associated with HomeBrew?