Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.99k stars 11.36k forks source link

Warning: You have uncommitted modifications to Homebrew's core. #11761

Closed chrishough closed 12 years ago

chrishough commented 12 years ago

I have been troubleshooting how to remove my final homebrew doctor error message and I can not seem to get rid of it:

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

Stack Overflow: http://stackoverflow.com/questions/10238786/homebrew-brew-doctor-fail-message

Yes, I run the "cd /usr/local && git reset --hard" message but it never goes away. I discovered this trying to figure out when I can not get brew install mysql to run.

mistydemeo commented 12 years ago

Can you cd /usr/local, perform git status, and paste the output to gist.github.com?

chrishough commented 12 years ago

yep, here you go: https://gist.github.com/2425123

mistydemeo commented 12 years ago

OK, these seem to be files which exist in your repo that have been removed from Homebrew. Check over the list to make sure that none of them are files you created that you don't want to lose, then do:

git clean -df

This will delete ALL these files and directories, so double-check that there's nothing of yours there before you do!

If you git status again, you should see that the working tree is clean and brew doctor will be clean.

chrishough commented 12 years ago

yep, I am good go to "Your system is raring to brew." Thank you

diogoareia commented 12 years ago

Thanks, that worked for me!!!!!

nathancolgate commented 12 years ago

@mistydemeo Thanks!

509tyler commented 12 years ago

@mistydemeo Thanks -- yep, same for me!

quoideneuf commented 12 years ago

Also worked for me. Thanks.

pabuisson commented 12 years ago

Didn't know about this "git clean -df" command. It's working for me as well, had uncomitted change there. Many thanks !

derekclee commented 12 years ago

Thanks! Worked for me too.

victorlcampos commented 11 years ago

Thanks! Worked for me too.

Sharpie commented 11 years ago

Just a word of caution on git clean: unlike git reset it will destroy files that aren't part of Homebrew. We have a pretty good .gitignore file that will check the destructive effects, but always, always run git clean -dn first to do a "dry run" and make sure there is nothing important that is about to get blown away.

If you can't tell which files are important, then just skip the clean---getting rid of a doctor warning is not worth the risk of blowing your fingers off.

bencooling commented 11 years ago

Thanks!

tradesmanhelix commented 9 years ago

FWIW, running git clean -df borked my brew install. Started getting errors about missing Ruby gems.

Was able to fix using the info from brew issue https://github.com/Homebrew/homebrew/issues/21002 (basically, reset the git head before trying a git clean:

cd /usr/local
git reset --hard origin/master
git clean -df

Brew is working great now!

Hoping this saves someone a bit of trouble in the future :)