From 47cdd4d8190c2e8be4758c019c986ccccbe50f11 Mon Sep 17 00:00:00 2001 From: Patrick Lucas Date: Wed, 13 Jun 2012 13:10:27 -0400 Subject: [PATCH] Suggest git clean -f for untracked changes Currently, if brew doctor detects untracked changes in the local repo, it suggests doing 'git reset --hard', but that doesn't remove untracked files. This change adds an additional suggestion to run 'git clean -f' to remove them. Closes Homebrew/homebrew#12814. Signed-off-by: Max Howell Changed the path to Library as we don't want to clean -f all over the whole /usr/local :P --- Library/Homebrew/cmd/doctor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 4117458ef7..aa120c7aa9 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -785,7 +785,7 @@ def check_git_status unless `git status -s -- Library/Homebrew/ 2>/dev/null`.chomp.empty? then <<-EOS.undent You have uncommitted modifications to Homebrew's core. Unless you know what you are doing, you should run: - cd #{HOMEBREW_REPOSITORY} && git reset --hard + cd #{HOMEBREW_REPOSITORY}/Library && git reset --hard && git clean -f EOS end end